Closed decoqt closed 4 years ago
Though I've not used golang:alpine, the message fatal: morestack on g0
shows that the assigned stack size is too small.
Do you know how to increase the stack size?
Though I've not used golang:alpine, the message
fatal: morestack on g0
shows that the assigned stack size is too small. Do you know how to increase the stack size?
Maybe, this error happens when I create many G2s, such as make([]G2,10240). One strange thing is that G1 and Fr computation is ok in this case.
I donot how to increase the stack size, I'm searching it.
You can decrease the stack size of mcl by decreasing maxMulVecN
and maxMulVecNGLV
.
https://github.com/herumi/mcl/blob/master/include/mcl/op.hpp#L120-L121
Could you try it?
You can decrease the stack size of mcl by decreasing
maxMulVecN
andmaxMulVecNGLV
. https://github.com/herumi/mcl/blob/master/include/mcl/op.hpp#L120-L121Could you try it?
diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp
index 958d438..3402be3 100644
--- a/include/mcl/op.hpp
+++ b/include/mcl/op.hpp
@@ -117,8 +117,8 @@ const size_t UnitBitSize = sizeof(Unit) * 8;
const size_t maxUnitSize = (MCL_MAX_BIT_SIZE + UnitBitSize - 1) / UnitBitSize;
#define MCL_MAX_UNIT_SIZE ((MCL_MAX_BIT_SIZE + MCL_UNIT_BIT_SIZE - 1) / MCL_UNIT_BIT_SIZE)
-const size_t maxMulVecN = 32; // inner loop of mulVec
-const size_t maxMulVecNGLV = 16; // inner loop of mulVec with GLV
+const size_t maxMulVecN = 16; // inner loop of mulVec
+const size_t maxMulVecNGLV = 8; // inner loop of mulVec with GLV
struct FpGenerator;
struct Op;
Works fine now! Need test more. Thanks very much!
I compile on golang:alpine, but G2Mul got error.
environmet is:
I compile my apps using cgo:
error is:
This seems only appear on alpine image.