Open rinx opened 4 years ago
@rinx I've just had this same fatal error. I've fixed by changing from:
@CFunction(value = "foo", transition = CFunction.Transition.NO_TRANSITION)
to:
@CFunction(value = "foo", transition = CFunction.Transition.TO_NATIVE)
Basically, any reentrant calls back to Java need to be signalled, otherwise the code thinks you're calling it from the wrong place (java instead of native).
I've encountered the same issue described here. Has there been any progress or known workarounds? It's causing some challenges on my end, and any guidance would be greatly appreciated.
I encountered the same issue, and it was due to an IsolateThread being used from a different native thread, i.e., not the one that initialized it.
Describe the issue
An error like the following occurs when running a Go app that calls a function in a shared library (built using native-image) from a hundred of goroutines through cgo.
I couldn't find a cause of this problem. Is this a bug of shared libraries built using native-image? Or is there any constraints when using shared libraries built using native-image? If you have any ideas to solve this problem, please help me. Thanks.
Steps to reproduce the issue I pushed a sample code (https://github.com/rinx/graalvm-java-cgo-test) to reproduce this problem.
git clone --depth 1 https://github.com/rinx/graalvm-java-cgo-test.git
cd graalvm-java-cgo-test
make target/call_from_go
export LD_LIBRARY_PATH=target/native
./target/call_from_go
Describe GraalVM and your environment:
More details native-image command (with
--native-image-info
and--verbose
flags) and its outputs.Error message when crash the binary
./target/call_from_go
.