RFR: 8351733: [macos] Crash when creating too many nested event loops [v2]
Martin Fox
mfox at openjdk.org
Mon Mar 24 15:47:28 UTC 2025
On Fri, 21 Mar 2025 21:15:27 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added explanation for limit on nested run loop calls
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1741#discussion_r2010442538
More information about the openjfx-dev
mailing list