-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
jmeter crahes when using openjdk bundled with the brew formula #150824
Comments
I got the same behaviour, thank your for pointing this out. doing:
but when installing jmeter with brew: brew install jmeter it downloads and installs the openjdk17. I edited the /opt/homebrew/Cellar/jmeter/5.6.2/bin/jmeter to point to my already installed jdk21 and it works. |
From data points, it sounds like Homebrew's I can reproduce issue. I have also confirmed that installing Ventura So, it looks like something went wrong building |
Looks like reports are a bit mixed for Not sure if anyone else has data points for OpenJDK built on macOS 14 Sonoma. I think most other distributions build on older macOS given common runners don't even support Sonoma (e.g. GitHub/Azure |
This is a bug on Apple's part. OpenJDK relies on a framework shipped with macOS called JavaRuntimeSupport. It appears this framework triggers behaviour that causes this crash. The reason you don't see this crash on other OpenJDK builds is because the crash is programmed to only happen when the program was built against the macOS 14 SDK. Many vendors haven't updated their build systems yet and distribute one macOS build. We distribute several macOS builds per OS version built with the corresponding SDK, so we would naturally be the first one hit by this issue. |
@Bo98 can someone report this to Apple? |
Done so as FB13297978 |
For now, what we might do is remove Sonoma bottles from OpenJDK. To do that, we will however need to come up with a minimal reproducible code that triggers the crash that we could add to our OpenJDK test. I don't have Sonoma-compatible hardware so I'm unable to do this currently. It might be as simple as opening a AWT window. Or maybe it'll need that + a couple things added to the menu bar. |
It needs to have something added to the menu bar. Oddly enough, https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_macos-x64_bin.tar.gz works. import javax.swing.*;
public class Test {
public static void main(String... args) throws Exception {
System.setProperty("apple.laf.useScreenMenuBar", "true");
JFrame frame = new JFrame("Test Frame");
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu();
JPanel panel = new JPanel();
panel.add(new JLabel("Test"));
frame.setJMenuBar(menuBar);
menuBar.add(menu);
frame.add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
} |
Also had the same crash with JOSM and the homebrew OpenJDK on Apple Silicon. |
For anyone suffering with their own app, finds this issue, and who wants a quick and probably temporary fix, dropping this code into some JNI removes the problematic method from #import <objc/runtime.h>
@interface JRSMenu
- (void)installCarbonEventHandlers:(NSNotification *)notification;
@end
void fixJavaRuntimeSupport() {
Class jrsMenuClass = NSClassFromString(@"JRSMenu");
if (jrsMenuClass) {
Method originalMethod = class_getInstanceMethod(jrsMenuClass, @selector(installCarbonEventHandlers:));
if (originalMethod) {
IMP newImp = imp_implementationWithBlock(^(NSNotification *notification) {
// NSLog(@"Ignoring notification %@", notification);
});
class_replaceMethod(jrsMenuClass, @selector(installCarbonEventHandlers:), newImp, method_getTypeEncoding(originalMethod));
}
}
} |
Not sure if it's the same issue, but on my macOS 14.1 Ghidra constantly crashes with Homebrew's |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I don't think this problem is resolved yet. I recently ran into this issue with plantuml. |
I still have this issue with Mac Book Pro with Intel Chipset with Sonoma 14.1.2. Error:
I did remove JMeter and installed a fresh and the latest(5.6.2) still has the same issue. And also I changed JMeter start script to use the JDK 21 by updating the script:
Please let me know if I need to capture any specific data to post here that will help. |
I also had this issue with JVisualVM |
+1 (base) ➜ tmp $(brew --prefix openjdk)/bin/java --version
openjdk 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)
(base) ➜ tmp
(base) ➜ tmp
(base) ➜ tmp jmeter
WARNING: package sun.awt.X11 not in java.desktop
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
2023-12-25 13:59:44.629 java[95550:25430921] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
================================================================================
Don't use GUI mode for load testing !, only for Test creation and Test debugging.
For load testing, use CLI Mode (was NON GUI):
jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder]
& increase Java Heap to meet your test requirements:
Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file
Check : https://jmeter.apache.org/usermanual/best-practices.html
================================================================================
/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter: line 199: 95550 Trace/BPT trap: 5 "$JAVA_HOME/bin/java" $ARGS $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"
(base) ➜ tmp
|
A full example would be nice :) |
I'm having the same problem and I couldn't solve it. When I solve it, I will write the result here. |
I'm having the same problem here |
@Bo98, do you know if this was fixed? On OpenJDK side, there was a mention that this may have been included with macOS 14.2 - https://bugs.openjdk.org/browse/JDK-8319420. I don't think we rebuilt OpenJDK bottles since, but there are some open PRs that should allow us to rebuild with newer SDK. EDIT: Tested local rebuild and it seems to work. |
For other JDKs, users may need to wait on open PRs (or we can try triggering a rebuild job if any PR gets stalled): |
Bug report with Apple is still open, but they may have forgotten to update it. It does seem indeed fixed in macOS 14.2 - an exception to the crash has been added for JRSMenu. It should be a runtime change and thus not require rebuilds. For everyone following this issue: please update to macOS 14.2 and avoid 14.0 and 14.1. Note: you may still see a warning logged to stdout. This is expected behaviour. |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output" saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Use jmeter, but it crashes on start on Mac m1.
Related issue: apache/jmeter#6083 (comment)
To fix jmeter crash, edit:
/opt/homebrew/Cellar/jmeter/5.6.2/bin/jmeter
Changing this:
#!/bin/bash
JAVA_HOME="/opt/homebrew/opt/openjdk@17" exec "/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter" "$@"
to this:
#!/bin/bash
exec "/opt/homebrew/Cellar/jmeter/5.6.2/libexec/bin/jmeter" "$@"
It will use my configured JDK instead of provided by Homebrew and it will not crash.
I think version that is linked by home-brew is not compatible.
What happened (include all command output)?
jmeter failed to launch, jmeter crashes
What did you expect to happen?
jmeter to launch
Step-by-step reproduction instructions (by running
brew
commands)brew install jmeter && jmeter
The text was updated successfully, but these errors were encountered: