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

Kevin Rushforth kcr at openjdk.org
Mon Mar 24 17:54:21 UTC 2025


On Mon, 24 Mar 2025 15:44:30 GMT, Martin Fox <mfox at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/native-glass/mac/GlassApplication.m line 759:
>> 
>>> 757: + (BOOL)canStartNestedEventLoop
>>> 758: {
>>> 759:     return nestedRunLoopRunCount <= 250;
>> 
>> How sure are you that 250 is a safe limit? Are there situations where we might not be able to do this many?
>> 
>> I recommend added a comment as to where the magic number "250" comes from. And maybe put it in a static const variable?
>
> I added a comment explaining where the number comes from. Since it's only used in this one spot putting it in a static const variable seemed redundant.
> 
> I'm not sure that 250 is a safe limit. I know that the JUnit test crashes if this value is set to 252 but succeeds at 251. I don't want to risk disturbing existing apps but since each count represents a runnable waiting for an event loop to exit even 200 seems like a high number. It might be prudent to set this to, say, 246 to give us a bit more headroom.

I agree that it might be wise to set it a bit lower, so either 246 or even 240 seems reasonable.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1741#discussion_r2010666441


More information about the openjfx-dev mailing list