graalvm

Ingy döt Net 2025-10-18T21:01:39.898289Z

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.

jyn 2025-10-18T21:46:37.789199Z

the error message seems rather good, which part are you confused about?

Ingy döt Net 2025-10-19T01:44:29.957369Z

Have you seen this error before?

Ingy döt Net 2025-10-19T01:50:24.693719Z

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.

Ingy döt Net 2025-10-19T01:51:24.233669Z

I only seem to get it the first time I run the binary I'm creating. After that it works fine.

Ingy döt Net 2025-10-19T20:26:52.236929Z

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...

borkdude 2025-10-19T20:56:10.058199Z

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?)

borkdude 2025-10-19T20:56:47.219009Z

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

✅ 1
Ingy döt Net 2025-10-19T20:59:39.515999Z

I asked in https://graalvm.slack.com/archives/CN9KSFB40/p1760906277587999 (#native-image)

👍 1
Ingy döt Net 2025-10-19T21:01:08.010439Z

But now they fixed thisWhich version? I'm on v24

Ingy döt Net 2025-10-19T21:02:13.316559Z

I'm pretty sure graalvm shared libs can't use musl btw

borkdude 2025-10-19T21:02:18.507869Z

October 2022: https://github.com/oracle/graal/issues/3398

Ingy döt Net 2025-10-19T21:02:28.753599Z

thx

borkdude 2025-10-19T21:02:54.331109Z

is there a reason why application can and shared libs can't?

Ingy döt Net 2025-10-19T21:03:43.835459Z

I just know I can build apps with musl but not libs. I'll gen the error. sec

borkdude 2025-10-19T21:04:17.159009Z

I guess it doesn't make sense to make statically linked libraries since the point of libraries is that you actually use separate libraries

Ingy döt Net 2025-10-19T21:19:00.399809Z

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.

Ingy döt Net 2025-10-19T21:29:18.016169Z

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...