RFR: 8351733: [macos] Crash when creating too many nested event loops [v3]

Martin Fox mfox at openjdk.org
Wed Mar 26 17:13:25 UTC 2025


On Wed, 26 Mar 2025 08:30:08 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

> Why would an application need to be tested against a specific limit?

If you knew that your app could hit a limit and the limit could vary by platform you would want to focus your testing on the platform with the lowest limit. In any case it's always annoying when a program works on one platform and fails on another. Better to have it fail the same way everywhere if possible (and in this case we can make that happen).

> An application that can conceivably start a nested event loop should always check whether it can start the event loop in the first place, and fail gracefully if it can't.

This would require adding checks before any calls that start a nested event loop. In the test case submitted by the customer the check would have to occur before a call to `Stage.showAndWait`. On the Mac a nested event loop is entered whenever the fullscreen state changes. I don't think there's any good way for a developer to know which JavaFX calls might enter a nested event loop.

As far as we know this crash is triggered when the app enters an unexpected state of runaway recursion. I think the goal is to keep the system from crashing long enough to get a Java stack trace to understand how the system got into that state. In the case submitted by the customer the stack trace suggests that JavaFX is throwing an exception that it should not be throwing (I was able to reproduce the recursive state but am still sorting through the rubble).

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1741#issuecomment-2755141407


More information about the openjfx-dev mailing list