Help. Installed Gatsby and now Mafia won't start

B-Love

New member
I don't know if anyone can make sense of the logfile that is created. I updated homebrew and used it to install Gatsby.js, the Gatsby CLI, Git, and Node. Not sure at what point I became incapable of running Mafia. Can someone help? Here's a snippet of the logfile in case it helps.

# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x00007ff817b81bc5, pid=1221, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0.1) (build 21.0.1)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21.0.1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C [AppKit+0xc92bc5] _NSCarbonMenuCrashIfNeeded+0x258
#
 

B-Love

New member
brianlovely@MacBook-Air-4 % java -version

openjdk version "21.0.1" 2023-10-17

OpenJDK Runtime Environment Homebrew (build 21.0.1)

OpenJDK 64-Bit Server VM Homebrew (build 21.0.1, mixed mode, sharing)

I also see this:
Application Specific Information:
References to Carbon menus are disallowed with AppKit menu system (see rdar://101002625). Use instances of NSMenu and NSMenuItem directly instead.

I also installed the Xcode CLI tools
 

MCroft

Developer
Staff member
I hadn't tried Java 21 (I'll need to upgrade Gradle), but I know we haven't touched the menus in ages.

I downloaded the Java 21 JDK from https://adoptium.net/temurin/releases/?os=mac and ran the app successfully from the command line.

I'm on an Intel Mac, btw, but we also have devs who could see if this was M1+ specific

Here's before and after:

Bash:
 java -jar ~/projects/kolmafia/dist/KoLmafia-27781-M.jar

KoLmafia r27781-M
Build main-385edfc-M 18.0.2.1 (Eclipse Adoptium 18.0.2.1+1) Mac OS X x86_64 14.3

Currently Running on Mac OS X
Local Directory is /Users/mcroft/Library/Application Support/KoLmafia
Using Java 18.0.2.1

Michaels-MBP:~ mcroft$ export JAVA_HOME='/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home'
Michaels-MBP:~ mcroft$ java -version
openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode)
Michaels-MBP:~ mcroft$ java -jar ~/projects/kolmafia/dist/KoLmafia-27781-M.jar

KoLmafia r27781-M
Build main-385edfc-M 18.0.2.1 (Eclipse Adoptium 18.0.2.1+1) Mac OS X x86_64 14.3

Currently Running on Mac OS X
Local Directory is /Users/mcroft/Library/Application Support/KoLmafia
Using Java 21.0.1

So, one thing I'd recommend is the terumin release. You can have lots of java versions installed. ( /usr/libexec/java_home -V to see options).

If it's not the home-brew JDK, it may be Apple Silicon vs. Intel, or it may be something else. And if you're building from scratch and you're pulling the code from Git (I use IntelliJ to do this, others use VSCode or other IDEs), you would definitely run into problems with Gradle.
 

B-Love

New member
Not sure how it was fixed, but I assume it was because I subsequently upgraded to Sonoma 14.2.1 Maybe the upgrade did some necessary cleanup. At least everything is running now.
 

MCroft

Developer
Staff member
It could be. I'm on Sonoma 14.3 and intel hardware, so we do have different environments. But there are a bunch of reports of this in other Java projects, and it's not clear what the exact differences are. Given that it's in Carbon, it's possible that they just hadn't implemented something in the Carbon layer for M1 Macs and there might have been a difference between the home-brew Java implementation and the Terumin implementation.

But in anywise, glad you're up and running again!
 

xKiv

Active member
I hadn't tried Java 21 (I'll need to upgrade Gradle), but I know we haven't touched the menus in ages.

Warnings for building with 21:
1) current-er gradle requires that tasks always have defined order of execution. Older gradle already gave warning about this, 8.5 upgrades them to errors. I added the following:

Code:
startScripts.mustRunAfter shadowJar
distTar.mustRunAfter shadowJar
startShadowScripts.mustRunAfter jar

2) java 21 (at least the adoptium version?) removed some method that's use by google-java-format in the version used by com.diffplug.spotless 6.12.0 (which is what cleanly checked out mafia build.gradle has) -> breaks build when calling googleJavaFormat

3) after upgrading java to 21, gradle to 8.5, and spotless to 6.23.3: calling spotless finds several new violations in build.gradle (I just followed the patches that it spat out at me - it was just line formatting), and once I fixed those it found so many new violations in java files that I gave up and just commeted out the line that calls googleJavaFormat
 
Top