[go-nuts] Re: deadlock "runtime.(*sigctx).preparePanic"

2018-10-04 Thread papostolescu2
Panic was caused by a stack smash, default cgo thread stack size was too small. My fix is to change cgo thread stack size at compile time by patching gcc_darwin_amd64.c, _cgo_sys_thread_start: 40a41,45 > #ifdef CGO_STACK_SIZE > size = CGO_STACK_SIZE; > pthread_attr_setstacksize(&attr, si

Re: [go-nuts] deadlock "runtime.(*sigctx).preparePanic"

2018-10-03 Thread papostolescu2
Thanks, I'll take a look at it. "recover" unfortunately does not help because control never gets back to the go side and this is the most difficult part - not knowing what the panic actually is. My current "workaround" is to timeout the cgo call in my code but I'm obviously leaking goroutines.

[go-nuts] Re: cgo & stack size

2018-10-01 Thread papostolescu2
Answering my own question: using -extflags and passing the appropriate clang options (-stack_size) ("go tool link" for all options). On Monday, October 1, 2018 at 3:24:11 PM UTC-4, papost...@gmail.com wrote: > > I'm using cgo to interop with a 3rd-party library which requires at least > 3MB o

Re: [go-nuts] cgo & stack size

2018-10-01 Thread papostolescu2
GOARCH="amd64" GOOS="darwin" - Paul On Monday, October 1, 2018 at 3:32:06 PM UTC-4, Ian Lance Taylor wrote: > > On Mon, Oct 1, 2018 at 12:21 PM, > > wrote: > > > > I'm using cgo to interop with a 3rd-party library which requires at > least > > 3MB of stack size - what is the proper way of

[go-nuts] cgo & stack size

2018-10-01 Thread papostolescu2
I'm using cgo to interop with a 3rd-party library which requires at least 3MB of stack size - what is the proper way of initializing code to support that ? All my cgo calls are done from separate goroutines which use channels for in/out. Thanks. -- You received this message because you are s