Bug macOS 14+ GUI crash caused by deprecated Carbon menu calls

labtheque

New member
Version: r28732
OS : MacOS 14.8.1 (Open Core Legacy Patcher)
Java: Temurin-21.0.5+11 (build 21.0.5+11-LTS)

I occasionally run autoascend overnight, like I did last night, and I woke up today to an error I've never seen before from macOS:

The action "Run Shell Script" encountered an error: "2025-10-22 00:54:02.997 java[52649:3396870] *** WARNING: References to Carbon menus are disallowed with AppKit menu system on macOS 14 and newer. Use instances of NSMenu and NSMenultem directly instead. See https:// developer.apple.com/documentation/macos-release-notes/
appkit-release-notes-for-macos-14#Menus"

I run mafia via an Automator script so I can just drop the newest jar into a folder, and also to force it to use Metal if possible instead of OpenGL, which I've copied below:

LATEST_JAR=$(ls -t ~/Applications/KoLMafia/KoLmafia-*.jar | head -n 1)
/usr/bin/xattr -d com.apple.quarantine "$LATEST_JAR" 2>/dev/null
/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/bin/java \
-Dsun.java2d.opengl=false \
-jar "$LATEST_JAR"

Here is also the beginning of macOS's crash report, which indicates it's specifically a GUI rendering issue, as the crash is in CVDisplayLink, a graphical rendering API, which matches the system report that it's an issue with Carbon. Apparently Sonoma much is stricter about not using it.

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process: java [52649]
Path: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/bin/java
Identifier: java
Version: ???
Code Type: X86-64 (Native)
Parent Process: Automator Application Stub [52646]
Responsible: Automator Application Stub [52646]
User ID: 501

Date/Time: 2025-10-22 10:05:57.5623 +0200
OS Version: macOS 14.8.1 (23J30)
Report Version: 12
Anonymous UUID: 3DF773ED-5120-0C07-F55B-DB659F63341E

Sleep/Wake UUID: 84669232-6A9E-42BC-8689-E740E2A1D2AF

Time Awake Since Boot: 560000 seconds
Time Since Wake: 168675 seconds

System Integrity Protection: enabled

Crashed Thread: 156 CVDisplayLink

Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x00002047994992c8
Exception Codes: 0x0000000000000001, 0x00002047994992c8

Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process: java [52649]

VM Region Info: 0x2047994992c8 is not in any region. Bytes after previous region: 35456453022409 Bytes before following region: 70061229763896
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
VM_ALLOCATE 838000000-840000000 [128.0M] ---/rwx SM=NUL
---> GAP OF 0x5ff7c0000000 BYTES
MALLOC_NANO 600000000000-600020000000 [512.0M] rw-/rwx SM=PRV

autoscend completed successfully according to the logs, but the GUI wasn't there.

I checked for a debug file, there was none, and I checked the logs for any mention of Carbon, but there was also none. I have attached the log just in case it might be useful.

If there's something you want me to add to my Automator script to log if/when it happens again, let me know.
 
28732, huh? That rules out our recent dependency upgrade (which was in r28733).

This nominally looks like a use-after-free because of how weird that address looks (and the line stating that it's not in any region, coupled with the fact that it's way too many bitflips away from a valid memory region to be memory errors), which I wouldn't expect from normal Java code (JNI on the other hand...). It definitely looks lower-level than anything we touch.

I'm a little curious to see the crash state of the registers, as well as the stack trace of the crashed thread (thread 156), but I'd be surprised if we have anything to do with that.

Have you upgraded your OS recently? Or your version of Java? I wouldn't expect the warning to be causally related -- it should just be a warning, not a crash. (It's also weird that the crash is a SIGABRT instead of a SIGSEGV.)
 
Cool, that makes a lot of sense. From what you’re saying, this probably falls into the “Kepler / legacy Metal acting up again” category and not something related to Mafia. I’m running Sonoma on unsupported hardware via OCLP (MacBook Pro 10,1, Early 2013), and the legacy Metal implementation plus patched-in Kepler support occasionally behave unpredictably.

I usually try to keep it on the Intel 4000 using gfxCardStatus for stability, but that isn’t 100% reliable. I’ve seen Java crash from GPU issues before, but I’ve never seen it trigger that specific Carbon menu warning or crash the GUI while Mafia itself kept running in the background - which is why I wanted to rule out Mafia as a factor.

I’ll attach the full crash report (and include thread 156 with the CVDisplayLink trace inline below) in case it’s useful for confirming it’s not on your end. My hunch based on your response is that it’s just Java and legacy Metal not playing nicely, or Kepler doing something weird at the driver level as usual. The Carbon menu warning was probably just a red herring or something completely unrelated to the crash.

Thanks for taking a look, it's very appreciated.

Thread 156 Crashed:: CVDisplayLink
0 libsystem_kernel.dylib 0x7ff8088acd96 __pthread_kill + 10
1 libsystem_pthread.dylib 0x7ff8088e5e51 pthread_kill + 262
2 libsystem_c.dylib 0x7ff80880ba69 abort + 126
3 libjvm.dylib 0x175de1bf1 os::abort(bool, void*, void const*) + 49
4 libjvm.dylib 0x1760607ed VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) + 2285
5 libjvm.dylib 0x17605fef4 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*, char const*, ...) + 132
6 libjvm.dylib 0x176060b21 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) + 33
7 libjvm.dylib 0x175efe61d JVM_handle_bsd_signal + 333
8 libsystem_platform.dylib 0x7ff808914fdd _sigtramp + 29
9 ??? 0x0 ???
10 CoreVideo 0x7ff811c564c8 CVDisplayLink::calculateNextWakeUpTime(CVTimeStamp*, CVTimeStamp*, bool) + 292
11 CoreVideo 0x7ff811c55aaa CVDisplayLink::runIOThread() + 392
12 libsystem_pthread.dylib 0x7ff8088e611f _pthread_start + 99
13 libsystem_pthread.dylib 0x7ff8088e1ac3 thread_start + 15
 

Attachments

Back
Top