JVM crashes on macOS when entering too many nested event loops
Andy Goryachev
andy.goryachev at oracle.com
Mon Mar 10 17:51:36 UTC 2025
This looks to me like it might be hitting the (native) thread stack size limit.
c.s.glass.ui.Application::enterNestedEventLoop() even warns about it:
* An application may enter several nested loops recursively. There's no
* limit of recursion other than that imposed by the native stack size.
-andy
From: openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Martin Fox <martinfox656 at gmail.com>
Date: Monday, March 10, 2025 at 10:10
To: Christopher Schnick <crschnick at xpipe.io>
Cc: OpenJFX <openjfx-dev at openjdk.org>
Subject: Re: JVM crashes on macOS when entering too many nested event loops
Hi Christopher,
I was able to reproduce this crash. I wrote a small routine that recursively calls itself in a runLater block and then enters a nested event loop. The program crashes when creating loop 254. I’m not sure where that limit comes from so it’s possible that consuming some other system resource could lower it. I couldn’t see any good way to determine how many loops are active by looking at the crash report since it doesn’t show the entire call stack.
I did a quick trial on Linux and was able to create a lot more loops (over 600) but then started seeing erratic behavior and errors coming from the Java VM. The behavior was variable unlike on the Mac which always crashes when creating loop 254.
Martin
> On Mar 7, 2025, at 6:24 AM, Christopher Schnick <crschnick at xpipe.io> wrote:
>
> Hello,
>
> I have attached a JVM fatal error log that seemingly was caused by our JavaFX application entering too many nested event loops, which macOS apparently doesn't like.
>
> As far as I know, there is no upper limit defined on how often an event loop can be nested, so I think this is a bug that can occur in rare situations.
>
> Best
> Christopher Schnick<hs_err_pid.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20250310/05f620b2/attachment-0001.htm>
More information about the openjfx-dev
mailing list