Dashstrom / tp-antlr

Basic project for UV AI21 of UTC using Maven, AntLR and JavaFX (with Visual Studio Code).
11 stars 3 forks source link

NSInternalInconsistencyException on Mac M1 #2

Open Dashstrom opened 2 months ago

Dashstrom commented 2 months ago

The following error occurs on some M1 Mac:

avr. 04, 2024 3:45:32 PM com.sun.javafx.application.PlatformImpl startup
AVERTISSEMENT: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @32aaaf82'
2024-04-04 15:45:33.776 java[24084:252530] *** Assertion failure in -[_NSTrackingAreaAKViewHelper removeTrackingRect:], _NSTrackingAreaAKManager.m:1637
2024-04-04 15:45:33.778 java[24084:252530] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '0x0 is an invalid NSTrackingRectTag. Common possible reasons for this are: 1. already removed this trackingRectTag, 2. Truncated the NSTrackingRectTag to 32bit at some point.'
*** First throw call stack:
(
        0   CoreFoundation                      0x000000018e6db0e4 __exceptionPreprocess + 176
        1   libobjc.A.dylib                     0x000000018e1f9fd0 objc_exception_throw + 60
        2   Foundation                          0x000000018f68ea48 -[NSCalendarDate initWithCoder:] + 0
        3   AppKit                              0x0000000191e3aa24 -[_NSTrackingAreaAKViewHelper removeTrackingRect:] + 200
        4   libglass.dylib                      0x0000000128a4f078 -[GlassViewDelegate setFrameSize:] + 360
        5   libglass.dylib                      0x0000000128a54170 -[GlassView3D setFrameSize:] + 92
        6   AppKit                              0x00000001918c16f8 -[NSView setFrame:] + 304
        7   libglass.dylib                      0x0000000128a541d0 -[GlassView3D setFrame:] + 76
        8   AppKit                              0x00000001918cf66c -[NSView resizeWithOldSuperviewSize:] + 508
        9   AppKit                              0x00000001918cf05c -[NSView resizeSubviewsWithOldSize:] + 360
        10  AppKit                              0x00000001918b353c -[NSView setFrameSize:] + 1136
        11  AppKit                              0x00000001918c16f8 -[NSView setFrame:] + 304
        12  AppKit                              0x00000001918cf66c -[NSView resizeWithOldSuperviewSize:] + 508
        13  AppKit                              0x00000001918cf05c -[NSView resizeSubviewsWithOldSize:] + 360
        14  AppKit                              0x00000001918b353c -[NSView setFrameSize:] + 1136
        15  AppKit                              0x00000001918cdcc8 -[NSThemeFrame setFrameSize:] + 244
        16  AppKit                              0x00000001918cd628 -[NSWindow _oldPlaceWindow:fromServer:] + 540
        17  AppKit                              0x00000001918cc6f8 -[NSWindow _setFrameCommon:display:fromServer:] + 1832
        18  libglass.dylib                      0x0000000128a5f140 Java_com_sun_glass_ui_mac_MacWindow__1setBounds2 + 416
        19  ???                                 0x0000000110f93bfc 0x0 + 4579736572
        20  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        21  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        22  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        23  ???                                 0x0000000110f8f1f4 0x0 + 4579717620
        24  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        25  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        26  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        27  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        28  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        29  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        30  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        31  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        32  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        33  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        34  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        35  ???                                 0x0000000110f8f1f4 0x0 + 4579717620
        36  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        37  ???                                 0x0000000110f8f1f4 0x0 + 4579717620
        38  ???                                 0x0000000110f8eee0 0x0 + 4579716832
        39  ???                                 0x0000000110f88144 0x0 + 4579688772
        40  libjvm.dylib                        0x0000000107f40274 _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP6Thread + 732
        41  libjvm.dylib                        0x0000000107fc72a4 JVM_DoPrivileged + 1572
        42  ???                                 0x0000000110f93bfc 0x0 + 4579736572
        43  ???                                 0x0000000110f8eee0 0x0 + 4579716832
        44  ???                                 0x0000000110f8f19c 0x0 + 4579717532
        45  ???                                 0x0000000110f8f1f4 0x0 + 4579717620
        46  ???                                 0x0000000110f88144 0x0 + 4579688772
        47  libjvm.dylib                        0x0000000107f40274 _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP6Thread + 732
        48  libjvm.dylib                        0x0000000107f829b8 _ZL20jni_invoke_nonstaticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPusherP6Thread + 556
        49  libjvm.dylib                        0x0000000107f86690 jni_CallVoidMethod + 264
        50  libglass.dylib                      0x0000000128a4aa48 -[GlassRunnable run] + 88
        51  Foundation                          0x000000018f5f6c14 __NSThreadPerformPerform + 264
        52  CoreFoundation                      0x000000018e6625ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
        53  CoreFoundation                      0x000000018e662540 __CFRunLoopDoSource0 + 176
        54  CoreFoundation                      0x000000018e6622b0 __CFRunLoopDoSources0 + 244
        55  CoreFoundation                      0x000000018e660eb8 __CFRunLoopRun + 828
        56  CoreFoundation                      0x000000018e660428 CFRunLoopRunSpecific + 612
        57  HIToolbox                           0x0000000197eb2df0 RunCurrentEventLoopInMode + 292
        58  HIToolbox                           0x0000000197eb2c2c ReceiveNextEventCommon + 648
        59  HIToolbox                           0x0000000197eb2984 _BlockUntilNextEventMatchingListInModeWithFilter + 76
        60  AppKit                              0x000000019188797c _DPSNextEvent + 636
        61  AppKit                              0x0000000191886b18 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
        62  AppKit                              0x000000019187af7c -[NSApplication run] + 464
        63  libglass.dylib                      0x0000000128a4cc1c -[GlassApplication runLoop:] + 1996
        64  Foundation                          0x000000018f5f6c14 __NSThreadPerformPerform + 264
        65  CoreFoundation                      0x000000018e6625ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
        66  CoreFoundation                      0x000000018e662540 __CFRunLoopDoSource0 + 176
        67  CoreFoundation                      0x000000018e6622b0 __CFRunLoopDoSources0 + 244
        68  CoreFoundation                      0x000000018e660eb8 __CFRunLoopRun + 828
        69  CoreFoundation                      0x000000018e660428 CFRunLoopRunSpecific + 612
        70  libjli.dylib                        0x0000000102aaf4e0 CreateExecutionEnvironment + 400
        71  libjli.dylib                        0x0000000102aab960 JLI_Launch + 1196
        72  java                                0x0000000102a27ba0 main + 396
        73  dyld                                0x000000018e22bf28 start + 2236
)
libc++abi: terminating due to uncaught exception of type NSException
zsh: abort      /usr/bin/env   fr.utc.Launcher
RayanDoudech commented 2 months ago

Hello, i have a fix for this issue.

On Mac M1/M2/M3 this is due to this issue => https://bugs.openjdk.org/browse/JDK-8296654.

JFx 17 is making a bad call to a methode into the lib "libglass.dylib", this method is calling an unsupported function on ARM chips.

Tested the project with :

Tested on Mac M1 and it's working, I Will make a PR to fix that issue, should be tested on windows & Linux to confirm that the project is still running.

Have a nice day :) R.