Closed dannote closed 3 years ago
Thanks for the report! I'll upgrade one of my machines to Monterey and will try to reproduce.
@meteorcloudy FYI
I filed an issue with Azul about this, it's a known issue:
I understand that Zulu11 is crashing immediately upon start on your M1 Mac running on Monterey.
I suspect that you have the latest developer build (eg. Beta-6) and if so, this is a known issue that should be remedied shortly.
...
2.) If so, there are a number of temporary work-arounds available until we release a fix.
(a) One option is to avoid this issue (with C2 compiler) by adding the following JVM parameters: -XX:+TieredCompilation -XX:TieredStopAtLevel=1
This can be accomplished by modifying your JVM startup parameters, or defining the environment variable _JAVA_OPTIONS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
If that doesn't work, then try using "JAVA_OPTS" instead. Please let me know if this (temporarily) resolves your issue satisfactorily or if you need further help with the solution.
(b) Since this issue began with a change made by Apple in the Beta-6 version of Monterey, another option is to use an earlier beta version of Monterey or stick to a commercially available build. Please let me know if this is an option for you.
(c) This issue affects Zulu11, Zulu13 and Zulu15. So another option is to download Zulu16, Zulu17 or Zulu18. Please let me know if that is an option for you.
(d) Finally, we have a solution in testing right now and it should be released imminently. You could wait until a fix is released (with a version greater than 11.50.19).
Excellent! Then we can just bump our embedded JDK to the latest version once the fix is out - and maybe we have to release a patch release for 4.2.1 if Apple doesn't want to fix it on their side and restore compatibility with the older OpenJDK. 😅
FYI @katre
So another option is to download Zulu16, Zulu17 or Zulu18
It sounds like if we were on one of these versions it would already be fixed? Is updating to one of those feasible?
FYI @meisterT, our JDK expert.
Updating the embedded JDK to OpenJDK 17 LTS shouldn’t be too hard, but we’d need to run performance regression tests first. I also wouldn’t feel so comfortable bumping the embedded JDK from 11 to 17 in a patch release of our Bazel LTS version 😅
I would be hesitant as well to bump the JDK in a patch release. But we should aim to do it before Bazel 5.0 is cut.
@dannote As a workaround for now, maybe you can install a compatible JDK version with Monterey and try with the Bazel binary without the embedded JDK? https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel_nojdk-4.2.1-darwin-arm64
@meteorcloudy I'll try, thank you
This appears to be fixed in monterey beta 7, I can no longer repro this crash 🎉
It looks like bazel_nojdk-4.2.1-darwin-arm64
works fine with OpenJDK 17
It seems that it's a bit too early to bump to OpenJDK 17. I ran into issues related to JSR 376:
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(byte[],byte) accessible: module java.base does not "opens java.lang" to unnamed module @22272bbe
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
at com.google.devtools.build.lib.unsafe.StringUnsafe.<init>(StringUnsafe.java:75)
at com.google.devtools.build.lib.unsafe.StringUnsafe.initInstance(StringUnsafe.java:56)
at com.google.devtools.build.lib.unsafe.StringUnsafe.<clinit>(StringUnsafe.java:37)
... 19 more
Given the fix in beta 7, unless folks can reproduce with that newer version, we can probably close this.
Description of the problem / feature request:
Bazel installer crashes on macOS Monterey
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
macOS 12.0 Beta (21A5506j)
Have you found anything relevant by searching the web?
Unfortunately no
Any other information, logs, or outputs that you want to share?