JDK-8299159 : [macos] HIToolbox assertion error output on macOS 13 Ventura
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx20
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: os_x
  • CPU: generic
  • Submitted: 2022-12-19
  • Updated: 2024-01-04
  • Resolved: 2024-01-04
Related Reports
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
I execute the code using `gradle run` with Gradle 7.6. My JDK is 18.0.2. I am unsure if this matters, but my Xcode is up to date (14.2).

I’m a JavaFX developer using a silicon Mac. Issues started immediately after updating my Mac to Ventura 13.1 (22C65) a few hours ago.

A DESCRIPTION OF THE PROBLEM :
I’m a JavaFX developer using a silicon Mac. Immediately after updating my Mac to Ventura 13.1 (22C65) a few hours ago, I started to have this issue. I have never seen this issue before.

Any JavaFX app I run from source produces error output. I can not find a single workaround. The output does not explain the cause. Google searches on the text within the output produce no useful results. I have tried restarting my computer, but the problem persists.

Attached is a compressed reproducer project. I can reliable reproduce the error output by running this. If I comment out the line that launches the JavaFX app, the error output is not produced.

I execute the code using `gradle run` with Gradle 7.6. My JDK is 18.0.2. I am unsure if this matters, but my Xcode is up to date (14.2).

The following is the full console output. The error output is in between “Hello world” and “Goodbye world”, and it is red in my console.

========================================================================================================================
/Users/matthewgroth/.gradle/wrapper/dists/gradle-7.6-all/9f832ih6bniajn45pbmqhk2cw/gradle-7.6/bin/gradle run

> Configure project :
Project : => no module-info.java found

> Task :run
Hello world
1   HIToolbox                           0x000000018fd8ad4c _ZN15MenuBarInstance21IsAutoShowHideAllowedEv + 284
2   HIToolbox                           0x000000018fc64230 _ZN15MenuBarInstance24UpdateAutoShowVisibilityE5Pointh + 40
3   HIToolbox                           0x000000018fc64184 _ZN15MenuBarInstance14EnableAutoShowEv + 56
4   HIToolbox                           0x000000018fc07310 SetMenuBarObscured + 372
5   HIToolbox                           0x000000018fc06ee8 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 172
6   HIToolbox                           0x000000018fc00fcc _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 296
7   HIToolbox                           0x000000018fbc7cd0 _NotifyEventLoopObservers + 176
8   HIToolbox                           0x000000018fc0096c AcquireEventFromQueue + 432
9   HIToolbox                           0x000000018fbefc84 ReceiveNextEventCommon + 320
10  HIToolbox                           0x000000018fbefb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
11  AppKit                              0x000000018979c424 _DPSNextEvent + 632
12  AppKit                              0x000000018979b5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
13  libglass.dylib                      0x000000010145bd88 JNI_OnLoad + 9324
14  libglass.dylib                      0x000000010145c8bc Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 64
15  ???                                 0x0000000109e818ac 0x0 + 4461172908
16  ???                                 0x0000000109e7dd80 0x0 + 4461157760
17  ???                                 0x0000000109e7dd80 0x0 + 4461157760
18  ???                                 0x0000000109e7dd80 0x0 + 4461157760
19  ???                                 0x0000000109e7dd80 0x0 + 4461157760
20  ???                                 0x0000000109e7dfc8 0x0 + 4461158344
21  ???                                 0x0000000109e7dfc8 0x0 + 4461158344
22  ???                                 0x0000000109e78140 0x0 + 4461134144
23  libjvm.dylib                        0x0000000101c4cda8 _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP10JavaThread + 908
24  libjvm.dylib                        0x0000000101ca687c _ZL20jni_invoke_nonstaticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPusherP10JavaThread + 796
25  libjvm.dylib                        0x0000000101caaf58 jni_CallVoidMethod + 312
26  libglass.dylib                      0x0000000101459d24 JNI_OnLoad + 1032
27  CoreFoundation                      0x0000000186511570 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
28  CoreFoundation                      0x00000001865af054 ___CFXRegistrationPost_block_invoke + 88
29  CoreFoundation                      0x00000001865aef9c _CFXRegistrationPost + 440
30  CoreFoundation                      0x00000001864e2b74 _CFXNotificationPost + 708
31  Foundation                          0x00000001873d072c -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
32  AppKit                              0x000000018978fc24 -[NSApplication finishLaunching] + 248
33  AppKit                              0x000000018978f910 -[NSApplication run] + 252
34  libglass.dylib                      0x000000010145bb70 JNI_OnLoad + 8788
35  Foundation                          0x0000000187440b30 __NSThreadPerformPerform + 264
36  CoreFoundation                      0x000000018651ca18 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
37  CoreFoundation                      0x000000018651c9ac __CFRunLoopDoSource0 + 176
38  CoreFoundation                      0x000000018651c71c __CFRunLoopDoSources0 + 244
39  CoreFoundation                      0x000000018651b320 __CFRunLoopRun + 836
40  CoreFoundation                      0x000000018651a888 CFRunLoopRunSpecific + 612
41  libjli.dylib                        0x00000001008a2fec CreateExecutionEnvironment + 400
42  libjli.dylib                        0x000000010089f1fc JLI_Launch + 1184
43  java                                0x00000001007ebba8 main + 408
44  dyld                                0x0000000186113e50 start + 2544
1   HIToolbox                           0x000000018fd8ad4c _ZN15MenuBarInstance21IsAutoShowHideAllowedEv + 284
2   HIToolbox                           0x000000018fc64230 _ZN15MenuBarInstance24UpdateAutoShowVisibilityE5Pointh + 40
3   HIToolbox                           0x000000018fc68380 _ZL19AutoShowHideHandlerP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv + 104
4   HIToolbox                           0x000000018fbc84c0 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1092
5   HIToolbox                           0x000000018fbc7940 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 356
6   HIToolbox                           0x000000018fbc77d0 SendEventToEventTargetWithOptions + 44
7   HIToolbox                           0x000000018fc079cc _ZL29ToolboxEventDispatcherHandlerP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv + 472
8   HIToolbox                           0x000000018fbc8968 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 2284
9   HIToolbox                           0x000000018fbc7940 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 356
10  HIToolbox                           0x000000018fbddbb8 SendEventToEventTarget + 40
11  AppKit                              0x000000018979bad8 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2044
12  libglass.dylib                      0x000000010145bd88 JNI_OnLoad + 9324
13  libglass.dylib                      0x000000010145c8bc Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 64
14  ???                                 0x0000000109e818ac 0x0 + 4461172908
15  ???                                 0x0000000109e7dd80 0x0 + 4461157760
16  ???                                 0x0000000109e7dd80 0x0 + 4461157760
17  ???                                 0x0000000109e7dd80 0x0 + 4461157760
18  ???                                 0x0000000109e7dd80 0x0 + 4461157760
19  ???                                 0x0000000109e7dfc8 0x0 + 4461158344
20  ???                                 0x0000000109e7dfc8 0x0 + 4461158344
21  ???                                 0x0000000109e78140 0x0 + 4461134144
22  libjvm.dylib                        0x0000000101c4cda8 _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP10JavaThread + 908
23  libjvm.dylib                        0x0000000101ca687c _ZL20jni_invoke_nonstaticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPusherP10JavaThread + 796
24  libjvm.dylib                        0x0000000101caaf58 jni_CallVoidMethod + 312
25  libglass.dylib                      0x0000000101459d24 JNI_OnLoad + 1032
26  CoreFoundation                      0x0000000186511570 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
27  CoreFoundation                      0x00000001865af054 ___CFXRegistrationPost_block_invoke + 88
28  CoreFoundation                      0x00000001865aef9c _CFXRegistrationPost + 440
29  CoreFoundation                      0x00000001864e2b74 _CFXNotificationPost + 708
30  Foundation                          0x00000001873d072c -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
31  AppKit                              0x000000018978fc24 -[NSApplication finishLaunching] + 248
32  AppKit                              0x000000018978f910 -[NSApplication run] + 252
33  libglass.dylib                      0x000000010145bb70 JNI_OnLoad + 8788
34  Foundation                          0x0000000187440b30 __NSThreadPerformPerform + 264
35  CoreFoundation                      0x000000018651ca18 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
36  CoreFoundation                      0x000000018651c9ac __CFRunLoopDoSource0 + 176
37  CoreFoundation                      0x000000018651c71c __CFRunLoopDoSources0 + 244
38  CoreFoundation                      0x000000018651b320 __CFRunLoopRun + 836
39  CoreFoundation                      0x000000018651a888 CFRunLoopRunSpecific + 612
40  libjli.dylib                        0x00000001008a2fec CreateExecutionEnvironment + 400
41  libjli.dylib                        0x000000010089f1fc JLI_Launch + 1184
42  java                                0x00000001007ebba8 main + 408
43  dyld                                0x0000000186113e50 start + 2544
1   HIToolbox                           0x000000018fc645c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120
2   HIToolbox                           0x000000018fc0727c SetMenuBarObscured + 224
3   HIToolbox                           0x000000018fc06ee8 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 172
4   HIToolbox                           0x000000018fc00fcc _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 296
5   HIToolbox                           0x000000018fbc7cd0 _NotifyEventLoopObservers + 176
6   HIToolbox                           0x000000018fc0096c AcquireEventFromQueue + 432
7   HIToolbox                           0x000000018fbefc84 ReceiveNextEventCommon + 320
8   HIToolbox                           0x000000018fbefb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
9   AppKit                              0x000000018979c424 _DPSNextEvent + 632
10  AppKit                              0x000000018979b5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
11  libglass.dylib                      0x000000010145bd88 JNI_OnLoad + 9324
12  libglass.dylib                      0x000000010145c8bc Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 64
13  ???                                 0x0000000109e818ac 0x0 + 4461172908
14  ???                                 0x0000000109e7dd80 0x0 + 4461157760
15  ???                                 0x0000000109e7dd80 0x0 + 4461157760
16  ???                                 0x0000000109e7dd80 0x0 + 4461157760
17  ???                                 0x0000000109e7dd80 0x0 + 4461157760
18  ???                                 0x0000000109e7dfc8 0x0 + 4461158344
19  ???                                 0x0000000109e7dfc8 0x0 + 4461158344
20  ???                                 0x0000000109e78140 0x0 + 4461134144
21  libjvm.dylib                        0x0000000101c4cda8 _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP10JavaThread + 908
22  libjvm.dylib                        0x0000000101ca687c _ZL20jni_invoke_nonstaticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPusherP10JavaThread + 796
23  libjvm.dylib                        0x0000000101caaf58 jni_CallVoidMethod + 312
24  libglass.dylib                      0x0000000101459d24 JNI_OnLoad + 1032
25  CoreFoundation                      0x0000000186511570 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
26  CoreFoundation                      0x00000001865af054 ___CFXRegistrationPost_block_invoke + 88
27  CoreFoundation                      0x00000001865aef9c _CFXRegistrationPost + 440
28  CoreFoundation                      0x00000001864e2b74 _CFXNotificationPost + 708
29  Foundation                          0x00000001873d072c -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
30  AppKit                              0x000000018978fc24 -[NSApplication finishLaunching] + 248
31  AppKit                              0x000000018978f910 -[NSApplication run] + 252
32  libglass.dylib                      0x000000010145bb70 JNI_OnLoad + 8788
33  Foundation                          0x0000000187440b30 __NSThreadPerformPerform + 264
34  CoreFoundation                      0x000000018651ca18 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
35  CoreFoundation                      0x000000018651c9ac __CFRunLoopDoSource0 + 176
36  CoreFoundation                      0x000000018651c71c __CFRunLoopDoSources0 + 244
37  CoreFoundation                      0x000000018651b320 __CFRunLoopRun + 836
38  CoreFoundation                      0x000000018651a888 CFRunLoopRunSpecific + 612
39  libjli.dylib                        0x00000001008a2fec CreateExecutionEnvironment + 400
40  libjli.dylib                        0x000000010089f1fc JLI_Launch + 1184
41  java                                0x00000001007ebba8 main + 408
42  dyld                                0x0000000186113e50 start + 2544
Goodbye world

BUILD SUCCESSFUL in 5s
5 actionable tasks: 5 executed
========================================================================================================================



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Download the reproducer project
2. Execute "gradle run"

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No error output
ACTUAL -
error output

---------- BEGIN SOURCE ----------
I have attached a reproducer project as a .zip file to the openjfx listserv. I will attach it here if the ability to attach a file is available.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
I can not find any at all! Since the issue started when I updated MacOS and I cannot revert to a previous version of MacOS, there seems to be absolutely nothing I can do to avoid the flood of error output when running javaFX

FREQUENCY : always



Comments
This bug no longer happens on macOS 13.6.3, so I am closing as "Cannot reproduce".
04-01-2024

I no longer see this on macOS 14.1, so it seems likely that Apple has fixed a problem on their end. I'll retest on the latest macOS 13.x update.
04-01-2024

Regarding the above comment with the additional information: I now know why I only saw the assertions when switching in and out of full screen mode. I checked my settings and “Automatically hide and show the menu bar” was set to “In Full Screen Only”, which I'm fairly sure is the default, so what I was seeing is consistent with that. If I set it to “Always” I get the same behavior that the submitter of the bug noted. WORKAROUND: Go to "Settings" --> "Desktop & Dock" Set “Automatically hide and show the menu bar” to “Never” (or set it to "In Full Screen" and ignore the occasional warning when entering and exiting full screen).
22-12-2022

Additional information from the submitter: I have tracked down a workaround which also I think points us closer to what may be causing this. If I go to my MacOS settings, I have “Automatically hide and show the menu bar” to “Always”. If I set this to “Never”, it completely prevents all of the error output. If I set it back to “Always” the error output comes right back. Even if I change this Mac OS setting in the middle of a JavaFX runtime, it will have the expected effect. Turning it to “Always” during runtime will causes the JavaFX app to start have the error output, while turning it to “Never” during runtime will prevent any further error output from being produced as long as it stays on “Never”. So unless you are willing to put up with all of the error output, JavaFX is not fully compatible with the MacOS feature of automatically hiding the system menu bar right now.
22-12-2022

I ran a full build and test on macOS 13.1 using the production toolchain, XCode 12.4 + MacOSX11.1 SDK, and the only time I see the error output is when entering or exiting full screen. I can try a build using a newer Xcode (which I need to do anyway to verify the fix for JDK-8296654.
21-12-2022

This is not a duplicate of JDK-8295779, since that concerns a compile-time error when building the JDK (not JavaFX).
21-12-2022

This looks like a duplicate of JDK-8295779
21-12-2022

This was also reported on the openjfx-dev mailing list: https://mail.openjdk.org/pipermail/openjfx-dev/2022-December/037642.html
19-12-2022