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

NetBeans Crashes with MacOS Sonoma 14.0/1 #6647

Closed
ShadowM0nkey opened this issue Oct 31, 2023 · 15 comments
Closed

NetBeans Crashes with MacOS Sonoma 14.0/1 #6647

ShadowM0nkey opened this issue Oct 31, 2023 · 15 comments
Labels
kind:bug Bug report or fix os:macos

Comments

@ShadowM0nkey
Copy link

ShadowM0nkey commented Oct 31, 2023

Apache NetBeans version

Apache NetBeans 19

What happened

NetBeans immediately crashes on M1 Mac running Sonoma 14.0/1:


Translated Report (Full Report Below)

Process: java [20838]
Path: /usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home/bin/java
Identifier: java
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [20603]
Responsible: netbeans [20602]
User ID: 506

Date/Time: 2023-10-31 09:33:23.5979 -0700
OS Version: macOS 14.1 (23B74)
Report Version: 12
Bridge OS Version: 8.1 (21P1069)
Anonymous UUID: 2752008D-E126-8BD7-F59C-84663233EF02

Time Awake Since Boot: 7700 seconds

System Integrity Protection: enabled

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

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

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

VM Region Info: 0x2c is not in any region. Bytes before following region: 140737487110100
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
shared memory 7fffffed0000-7fffffed1000 [ 4K] r-x/r-x SM=SHM

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

How to reproduce

Upgrade M1 MacBook to Sonoma 14.0 or 14.1.

Launch NetBeans

Did this work correctly in an earlier version?

Apache NetBeans 19

Operating System

MacOS Sonoma 14.0 or 14.1

JDK

openjdk version "21.0.1" 2023-10-17

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

Similar error reported with JMeter & VisualVM:

apache/jmeter#6083
oracle/visualvm#528

Are you willing to submit a pull request?

Yes

@ShadowM0nkey ShadowM0nkey added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Oct 31, 2023
@mbien mbien added the os:macos label Oct 31, 2023
@mbien
Copy link
Member

mbien commented Oct 31, 2023

comments on the linked issues indicate that this seems to be JDK distribution dependent. What JDK are you using and have you tried a different vendor? You can also attach the log file which has environment information in it.

the NB 20 release candidates use the latest version of FlatLaf: #6581, although I don't remember reading anything about the menu system in the changelog, wouldn't hurt to give it a try.

edit: does NetBeans start if you switch to a different look and feel?

bin/netbeans --laf Metal

@ShadowM0nkey
Copy link
Author

@mbien You were correct. I ended up deleting the openjdk@21 version installed by HomeBrew and manually installed Amazon Corretto 21 and Netbeans now starts. Many thanks!

@mbien mbien removed the needs:triage Requires attention from one of the committers label Nov 1, 2023
@gtsh
Copy link

gtsh commented Apr 22, 2024

Just a heads up: Not exactly sure, whether this actually is the same problem, since your system spec says Sonoma 14.1, not Sonoma 14.4 / 14.4.1, but there seems to be a problem with the latest Sonoma releases, and all JDKs:

https://blogs.oracle.com/java/post/java-on-macos-14-4?source=:so:tw:or:awr:jav:::&SC=:so:tw:or:awr:jav:::&pcode=

The Blog says, that this should be fixed with 14.4.1 and OpenJDK >= 23 PRE, (They couldn't reproduce), but I'm running Netbeans 21 on Open JDK 22, and am still seeing a similar issue, that smells like it.

Particularly, after an extended time of using NetBeans, the machine locks up completely, and reboots to the login screen.
This seems to be so this sudden, that I need to delete the lockfile in the workdir manually, in order to restart NB. and the logfiles do not contain any hints.

I've come to the conclusion, that part of the problem is caused by the foreign management software used for the security lockdown of my machine - as a result, the JVM started by the MacOS launcher isn't able to write the JVM dumps for the lack of privileges - which currently limits my options to provide more insight.

Another cause might be, that I'm running with Preview Features enabled, because I tinker with the Java String Templates.

If somebody has a trick up his sleeves to circumvent this dump problem, or is able to report 'works for me'/'have the same problem', this might help to determine, if this is indeed the same problem.

@philip-lourandos-sgits
Copy link

I am seeing something similar with:

  • Macbook Pro m2
  • 14.5 (23F79)
  • Netbeans 22
  • openjdk 22.0.1 2024-04-16

Netbeans 19 and 20 are fine. Saw the same issue with netbeans 21

@gtsh
Copy link

gtsh commented Jun 6, 2024

@philip-lourandos-sgits So I'm not mistaken, the problem is real, and not an 'only me' one. I'm still a bit unsure, whether we are looking at exactly the same problem as the original poster, because he, at least, had a heapdump, and he crashed immediately.

Some quick questions:

  • did you install Jdk and Netbeans from archives, or did you use homebrew?
  • have you been able to generate a heapdump, or any meaningful log?

@philip-lourandos-sgits
Copy link

@philip-lourandos-sgits So I'm not mistaken, the problem is real, and not an 'only me' one. I'm still a bit unsure, whether we are looking at exactly the same problem as the original poster, because he, at least, had a heapdump, and he crashed immediately.

Some quick questions:

* did you install Jdk and Netbeans from archives, or did you use homebrew?

sdkman for the JDK. Downloaded zip file for netbeans from apache

* have you been able to generate a heapdump, or any meaningful log?

Not as yet.

@neilcsmith-net
Copy link
Member

Can you replicate with the pkg installer, or ideally the community pkg installer with internal JDK? Those are correctly deep signed and notarized, including the bundled JDK in the community installer. They also are app bundles with a swift launcher. Be good to know if this is specific to unsigned bundles, unsigned native binaries, etc.

@gtsh
Copy link

gtsh commented Jun 6, 2024

@neilcsmith-net Sure can do.

In the meantime, you might take a look at the log snippets I attached. Some context:
I experienced this first with Sonoma 14.4.1, Netbeans 21 and JDK Temurin-22.0.0, but like Philip moved on to Sonoma 14.5, Netbenas 22, Temurin-22.0.1+8.
In an attempt to get closer to the source of the problem, I placed the following additional parameters into the
etc/netbeans.conf:

netbeans_default_options=" 
-J-XshowSettings:all -J-XX:ErrorFile=/Users/<redacted>/Netbeans -J-XX:HeapDumpPath=/Users/<redacted>/Netbeans/HeapDump -J-Duser.language=en -J-Duser.country=US. <remaining default options> 

in the hopes to have a potential heap dump in a place where I know that I have write permissions.

I also called the shell script 'netbeans' directly from a wrapper, redirecting the output into a file sysout.txt.
From this I got the only hint so far: In the majority of cases, I have something like this: at the end

2024-06-05 00:43:09.471 java[22544:404143] *** WARNING: References to Carbon menus are disallowed with AppKit menu system on macOS 14 and newer. Use instances of NSMenu and NSMenuItem directly instead. See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14#Menus
2024-06-06 02:06:45.780 java[22544:404143] +[NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted
2024-06-06 02:06:45.783 java[22544:404143] HIToolbox: received notification of WindowServer event port death.
2024-06-06 02:06:45.783 java[22544:404143] port matched the WindowServer port created in BindCGSToRunLoop

logdump_2024-06-05-00-30.zip
logdump_2024-06-05-00-36.zip
logdump_2024-06-05-00-43.zip

P.S: Maybe we should move this to a separate, new Issue. As it seems to be different problem
P.P.S: that -jdkhome althought not set at all, gets passed on '' doesn't look right, but the JDK still gets picked all right, because Jenv was configured to set it as MacOS default.

@philip-lourandos-sgits
Copy link

Using the pkg file from netbeans.apache.org yielded the same result. Using the homebrew version appears to be stable

@gtsh
Copy link

gtsh commented Jun 15, 2024

Did as suggested; removed the whole NB installation, and installed from the pkg.

For about a week, it looked like it could be exactly the other way around for me, but no. The Problem seems to be elusive.
It happened particularly often, when I started to install or activate some plugins, not during installation, but when still clicking around to select things.

And again, with the same message on sysout/err:

** Success! found: /Users/foo.bar/Library/Application Support/NetBeans/22/modules/ext/server-cert-keystore.jks
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.netbeans.TopSecurityManager (file:/Applications/Apache%20NetBeans.app/Contents/Resources/netbeans/platform/lib/boot.jar)
WARNING: Please consider reporting this to the maintainers of org.netbeans.TopSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2024-06-15 12:34:44.320 java[95131:3714403] *** WARNING: References to Carbon menus are disallowed with AppKit menu system on macOS 14 and newer. Use instances of NSMenu and NSMenuItem directly instead. See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14#Menus
*** created X3DPaletteActions()
2024-06-15 12:57:15.175 java[95131:3714403] +[NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted
2024-06-15 12:57:15.176 java[95131:3714403] HIToolbox: received notification of WindowServer event port death.
2024-06-15 12:57:15.176 java[95131:3714403] port matched the WindowServer port created in BindCGSToRunLoop

logdump_2024-06-15-13-08.zip

@dyorgio
Copy link
Contributor

dyorgio commented Jun 27, 2024

Same problem here.
NetBeans 22 sometimes freeze and restart Finder (macOS shell) always during a Menu access or PopUp.
Sonoma 14.5
Azul Zulu 21 JDK

@ChMThiel
Copy link

Same problem here:
Product Version: Apache NetBeans IDE 22
Java: 22.0.1; OpenJDK 64-Bit Server VM 22.0.1
Runtime: OpenJDK Runtime Environment 22.0.1
(installed by Homebrew)

System: Mac OS X version 14.5 running on aarch64; UTF-8; de_DE (nb)

Pleas open a new issue...it seems there are a lot of people having that problem

@neilcsmith-net
Copy link
Member

Pleas open a new issue...it seems there are a lot of people having that problem

Why ask others to do what you can do yourself?? Please open a new issue with the information required to do so. Also please check if you can replicate with the community installers as that's using a known JDK signed along with the IDE.

@ChMThiel
Copy link

Pleas open a new issue...it seems there are a lot of people having that problem

Why ask others to do what you can do yourself?? Please open a new issue with the information required to do so. Also please check if you can replicate with the community installers as that's using a known JDK signed along with the IDE.

@neilcsmith-net you asked the same question to @gtsh and he told you that it makes no difference, how he installed netbeans. And he already suggested to move this to a new issue...

@neilcsmith-net
Copy link
Member

@ChMThiel actually, it wasn't the same question, and he didn't check this (at least in the comments and logs above). Let's move this over to the new issue. Thanks for opening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix os:macos
Projects
None yet
Development

No branches or pull requests

7 participants