Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisualVM crashes on macOS 14.0 Sonoma at launch (due to no longer supported Carbon menu APIs) #528

Closed
fwcd opened this issue Oct 4, 2023 · 14 comments
Labels

Comments

@fwcd
Copy link

fwcd commented Oct 4, 2023

Describe the bug
VisualVM crashes on macOS 14.0 Sonoma.

To Reproduce
Steps to reproduce the behavior:

  1. Open VisualVM on macOS 14

Expected behavior

To not crash.

Crash log

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

Process:               java [13354]
Path:                  /opt/homebrew/*/java
Identifier:            java
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        Exited process [13244]
User ID:               501

Date/Time:             2023-10-04 13:39:06.2193 +0100
OS Version:            macOS 14.0 (23A344)
Report Version:        12
Anonymous UUID:        F77EC4D1-E3BB-6DA3-0587-1AC8732E6ACD

Sleep/Wake UUID:       2FEAA728-CBAD-4DFF-8DD6-2FAEF239C7A1

Time Awake Since Boot: 370000 seconds
Time Since Wake:       12415 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x0000000189ed961c

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [13354]

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

Full crash log: visualvm-sonoma-crash.txt

Desktop (please complete the following information):

  • OS: macOS 14.0
  • JDK version: OpenJDK 21 (Homebrew)
  • Version: 2.1.7

Additional context

@fwcd fwcd added the bug label Oct 4, 2023
@thurka
Copy link
Member

thurka commented Oct 4, 2023

It does not look to me like VisualVM bug.

@fwcd
Copy link
Author

fwcd commented Oct 4, 2023

Looks like it could also be a bug in Apple's JavaRuntimeSupport framework (or somewhere in between that and AppKit), I've sent the crash log to them.

@thurka
Copy link
Member

thurka commented Oct 4, 2023

FYI: I am able to run VisualVM 2.1.7 on official build of OpenJDK 21 just fine on macOS 14.0.

-------------------------------------------------------------------------------
>Log Session: Wednesday, October 4, 2023, 7:33:22 PM Central European Summer Time
>System Info: 
  Product Version         = VisualVM 2.1.7
  Operating System        = Mac OS X version 14.0 running on x86_64
  Java; VM; Vendor        = 21; OpenJDK 64-Bit Server VM 21+35-2513; Oracle Corporation
  Runtime                 = OpenJDK Runtime Environment 21+35-2513
  Java Home               = /Users/thurka/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home

@fwcd
Copy link
Author

fwcd commented Oct 4, 2023

Hm, that's strange, perhaps the issue only occurs on Apple Silicon/arm64 Macs?

@sdavids
Copy link

sdavids commented Oct 5, 2023

I have the same problem:

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

Process:               java [10897]
Path:                  /Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home/bin/java
Identifier:            java
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        bash [10787]
User ID:               501

Date/Time:             2023-10-05 14:42:18.0807 +0200
OS Version:            macOS 14.0 (23A344)
Report Version:        12
Anonymous UUID:        C4681EC2-6242-F697-8752-AA7EFD28A6B8


Time Awake Since Boot: 28000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x00000001889c961c

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [10897]

Application Specific Information:
References to Carbon menus are disallowed with AppKit menu system (see rdar://101002625). Use instances of NSMenu and NSMenuItem directly instead.
$ sw_vers
ProductName:		macOS
ProductVersion:		14.0
BuildVersion:		23A344
$ uname -a
Darwin dev 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103 arm64
$ java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment Homebrew (build 21)
OpenJDK 64-Bit Server VM Homebrew (build 21, mixed mode, sharing)
$ /usr/libexec/PlistBuddy -c "Print:CFBundleName" -c "Print:CFBundleVersion" /Applications/VisualVM.app/Contents/Info.plist
VisualVM
2.1.7

@Jag026
Copy link

Jag026 commented Oct 10, 2023

I got this error running jmeter and was able to resolve it by updating Java. You may also need to set the JAVA_HOME variable, I created a temporary session for jmeter (you'll need to change this to the application you're using): export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter

@caizixian
Copy link

I had the same error. The VisualVM launch script selects the Homebrew OpenJDK.

/opt/homebrew/Cellar/openjdk/21/libexec/openjdk.jdk/Contents/Home/bin/java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment Homebrew (build 21)
OpenJDK 64-Bit Server VM Homebrew (build 21, mixed mode, sharing)

I workaround the problem by using Temurin 8.
visualvm_jdkhome=/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/ /Applications/VisualVM.app/Contents/MacOS/visualvm

@caizixian
Copy link

Temurin 17 and 21 are also fine (installed through Homebrew Cask). But not the normal Homebrew openjdk.

@caizixian
Copy link

So this could be a Homebrew openjdk formula problem.

@thurka
Copy link
Member

thurka commented Oct 17, 2023

So it looks like the Homebrew JDK is incorrectly built.

@thurka
Copy link
Member

thurka commented Nov 1, 2023

It is now clear that this not VisualVM issue. Closing.

@thurka thurka closed this as completed Nov 1, 2023
@andrewserff
Copy link

In case anyone else is running into this issue with other applications (It was affecting NetBeans for me), I found the solution in this issue on a different project: apache/jmeter#6083. Ultimately the solution was to use a different distribution of OpenJDK. Amazon Corretto seems to work (at least for NetBeans).

@b005t3r
Copy link

b005t3r commented Dec 13, 2023

In case anyone else is running into this issue with other applications (It was affecting NetBeans for me), I found the solution in this issue on a different project: apache/jmeter#6083. Ultimately the solution was to use a different distribution of OpenJDK. Amazon Corretto seems to work (at least for NetBeans).

That's definitely not the ultimate solution. I just tried the Amazon JDK and it does not fix the crash for me (it's a crash in my macOS app).

@r0k3tkutt3r
Copy link

I don't think this is simply for Homebrew since I also had this issue in MCreator (A Java-based minecraft mod creator)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants