Anyone familiar with:
Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code to Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.
the error message seems rather good, which part are you confused about?
Have you seen this error before?
I didn't say or imply that I was confused by this message. I just don't know why I'm getting it yet. Hoping someone is familiar with it.
I only seem to get it the first time I run the binary I'm creating. After that it works fine.
This issue seems to be heavily attached to CGO's FFI interaction with my native-image shared library. I have FFI binding libs in 15 different programming languages for this shared lib. The stack overflow happens intermittently over several test runs of a small go program using the binding. I ran this past cursor and claude code ai agents, and didn't have luck until I asked them to try same with python binding, and that worked; so asked cc to compare python binding with go's and it came up with a fix that hasn't seen a crash yet. Then I asked it to look at the other 13 bindings and it found 6 that seemed to have the same issue, but after testing they all work fine. Here's a gist with CC's overall assessment and also the patch that seems to have fixed yamslcript's go binding: https://gist.github.com/ingydotnet/acbd9601fccb48af21033cdadb0f167a I'm still not 100% confident. I might bring this up on graalvm's slack...
I've had similar issues once with musl compiled binaries where you had to start a new thread to run your entire program which increased stack memory. The default stack was just too low. But now they fixed this (using the same mechanism) in graalvm (at least for programs, maybe not libs?)
In any case, I'd ask this in the GraalVM Slack community rather than or in addition to this Slack since the GraalVM team hangs around there
I asked in https://graalvm.slack.com/archives/CN9KSFB40/p1760906277587999 (#native-image)
But now they fixed thisWhich version? I'm on v24
I'm pretty sure graalvm shared libs can't use musl btw
October 2022: https://github.com/oracle/graal/issues/3398
thx
is there a reason why application can and shared libs can't?
I just know I can build apps with musl but not libs. I'll gen the error. sec
I guess it doesn't make sense to make statically linked libraries since the point of libraries is that you actually use separate libraries
Hmmm. I may be wrong here.
For apps I needed to add --static and --libc=musl which fail for my shared lib build with
Error: Cannot pass both options: --shared and --static
but apparently I didn't try just removing the --static flag.
It seems to be building ok. Will know soon.https://gist.github.com/ingydotnet/72ad01833a34d174105acbc8ca384fbc It compiled but failed to link. Missing libz.a I'd have to make adjustments but looks like it should work...