IDE crashes on MacOS 10.15 Catalina
Symptoms
-
MacOS 10.15 Catalina is installed.
-
PhpStorm or any other IDE crashes with the following error in
java_error_in_<product>_<PID>.log
:# Problematic frame: # C [CoreGraphics+0x195930] ERROR_CGDataProviderCreateWithData_BufferIsNotReadable+0x10
Cause
HarfBuzz library is used by JDK in text layout. The library is interacting with Cocoa API in a way which is causing the crash on MacOS 10.15 Catalina.
Workaround
Replace JBR with the patched one using the switcher:
If the IDE could not be started use the following method to change JBR (this example is for IntelliJ IDEA):
sudo tar -C /Library/Java/JavaVirtualMachines/ -xvf jbrsdk-8u212-osx-x64-b1596.tar.gz
echo /Library/Java/JavaVirtualMachines/jdk > ~/Library/Preferences/IntelliJIdea2019.1/idea.jdk
See this document for more details about overriding the default runtime via the "<product>.jdk" file.
Examples for PyCharm, RubyMine, PhpStorm and WebStorm products (2019.1.x version):
echo /Library/Java/JavaVirtualMachines/jdk > ~/Library/Preferences/PyCharm2019.1/pycharm.jdk
echo /Library/Java/JavaVirtualMachines/jdk > ~/Library/Preferences/RubyMine2019.1/rubymine.jdk
echo /Library/Java/JavaVirtualMachines/jdk > ~/Library/Preferences/PhpStorm2019.1/phpstorm.jdk
echo /Library/Java/JavaVirtualMachines/jdk > ~/Library/Preferences/WebStorm2019.1/webstorm.jdk
Additional details regarding the problem are described in the scope of this YouTrack ticket.
Please sign in to leave a comment.
As the IDE stays 2sec before closing, I tried the terminal step but it didnt worked. It just created a file called "PhpStorm2019.jdk" in
~/Library/Preferences/PhpStorm2019.1 but I don't see how to link it with JBR folder
See https://intellij-support.jetbrains.com/hc/articles/206544879 for the details. You just put the path to the JBR installation directory into that file. Note that <product> for PhpStorm would be just "phpstorm", so the file name would be "phpstorm.jdk".
Created file "phpstorm.jdk", placed it into /Users/myname/Library/Preferences/PhpStorm2019.1/ and wrote into it /Users/myname/Downloads/jdk (root path of the JBR8 extracted), restarted IDE but still doesn't work ...
Try running PhpStorm from the Terminal to see which JDK is chosen and why:
Thank you for your answers. The commands give this :
2019-07-16 20:38:25.995 phpstorm[1183:32154] allVms required 1.8*,1.8+
2019-07-16 20:38:25.997 phpstorm[1183:32154] Found Java Virtual Machines:
2019-07-16 20:38:25.997 phpstorm[1183:32154] /Applications/PhpStorm.app/Contents/jdk
2019-07-16 20:38:25.997 phpstorm[1183:32154] Required VMs: 1.8*,1.8+
2019-07-16 20:38:25.997 phpstorm[1183:32154] Chosen VM:
2019-07-16 20:38:25.998 phpstorm[1183:32154] /Applications/PhpStorm.app/Contents/jdk
2019-07-16 20:38:25.999 phpstorm[1183:32162] Value of PHPSTORM_VM_OPTIONS is (null)
2019-07-16 20:38:25.999 phpstorm[1183:32162] fullFileName is: /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions
2019-07-16 20:38:25.999 phpstorm[1183:32162] fullFileName exists: /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions
2019-07-16 20:38:25.999 phpstorm[1183:32162] Processing VMOptions file at /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions
2019-07-16 20:38:26.000 phpstorm[1183:32162] Reading at /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions OK
2019-07-16 20:38:26.000 phpstorm[1183:32162] Done
Please submit a ticket to support with the logs directory attached so that we can investigate it further.
Sorry that was my fault, thank you this workaround works !! :)
Thanks for the workaround, its not crashing (that often) now.
Crashing alot while: copy/paste file to a folder / having power safe mode off
Running into the same problem with AppCode 2019.2 beta (latest version) on Catalina public beta 4.
Launching AppCode with `IDEA_LAUNCHER_DEBUG=true` from the command line reveals:
$ export IDEA_LAUNCHER_DEBUG=true
$ ~/Library/Application\ Support/JetBrains/Toolbox/apps/AppCode/ch-1/192.5728.22/AppCode\ 2019.2\ EAP.app/Contents/MacOS/appcode
2019-07-18 19:49:07.204 appcode[29358:669705] allVms required 1.8*,1.8+
2019-07-18 19:49:07.205 appcode[29358:669705] Found Java Virtual Machines:
2019-07-18 19:49:07.205 appcode[29358:669705] /Users/stuart/Library/Application Support/JetBrains/Toolbox/apps/AppCode/ch-1/192.5728.22/AppCode 2019.2 EAP.app/Contents/jbr
2019-07-18 19:49:07.205 appcode[29358:669705] Required VMs: 1.8*,1.8+
2019-07-18 19:49:07.205 appcode[29358:669705] Chosen VM:
2019-07-18 19:49:07.205 appcode[29358:669705] /Users/stuart/Library/Application Support/JetBrains/Toolbox/apps/AppCode/ch-1/192.5728.22/AppCode 2019.2 EAP.app/Contents/jbr
2019-07-18 19:49:07.207 appcode[29358:669713] Value of APPCODE_VM_OPTIONS is (null)
2019-07-18 19:49:07.207 appcode[29358:669713] Processing VMOptions file at /Users/stuart/Library/Application Support/JetBrains/Toolbox/apps/AppCode/ch-1/192.5728.22/AppCode 2019.2 EAP.app.vmoptions
2019-07-18 19:49:07.207 appcode[29358:669713] Reading at /Users/stuart/Library/Application Support/JetBrains/Toolbox/apps/AppCode/ch-1/192.5728.22/AppCode 2019.2 EAP.app.vmoptions OK
2019-07-18 19:49:07.208 appcode[29358:669713] Done
Error occurred during initialization of VM
**Could not find agent library yjpagent on the library path, with error: dlopen(libyjpagent.dylib, 1): image not found**
The solution (for me, at least) was to delete the line:
`-agentlib:yjpagent=probe_disable=*,disablealloc,disabletracing,onlylocal,disableexceptiontelemetry,delay=10000,sessionname=AppCode2019.1` from
from `/Users/stuart/Library/Application Support/JetBrains/Toolbox/apps/AppCode/ch-1/192.5728.22/AppCode 2019.2 EAP.app.vmoptions`
@Stuartro, your case is not related to the problem described in this document. Profiler agent was moved to a different location and your .vmoptions file was not adjusted. It looks like the issue is caused by the Toolbox settings migration, our team will investigate it, thanks for the report.
When I try the directions above to replace the JBR, I get this error from the OS on launch:
“libjvm.dylib” can’t be opened because its integrity cannot be verified.
Version:
Update: A temporary workaround for this is to completely disable macOS Gatekeeper:
sudo spctl --master-disable
Not ideal, but apparently necessary until JetBrains releases a JBR with the latest Catalina code signing.
Update 2: Still doesn’t launch, though. What appears to be the root cause of the error I get now is:
Caused by: java.lang.RuntimeException: Non-Java exception raised, not handled! (Original problem: *** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil)
at java.desktop/sun.font.CFontManager.loadNativeFonts(Native Method)
Update 3: It appears to crash while scanning my installed fonts. Temporarily renaming ~/Library/Fonts while launching IntelliJ fixes the problem:
sudo mv /Users/paul/Library/Fonts ~/Library/Fonts.disabled; IDEA_LAUNCHER_DEBUG=true /Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea & sleep 5; sudo mv ~/Library/Fonts.disabled /Users/paul/Library/Fonts
Hey folks,
after analyzing this error a bit because it also happened to my Jetbrains Toolbox and Google Chrome I realized that it actually has nothing to do with JDK whatsoever.
This error occurs if you have invalid fonts in you "Font Book" app aka. the ~/Library/Fonts folder.
You might have a while ago imported fonts without a "name" key which will result in this "key cannot be nil" error now.
To fix it simply rename the fonts folder to sth. like ~/Library/Fonts.bak and then start "Font Book" app and reimport the fonts from the ~/Library/Fonts.bak folder.
But this time don't import fonts with warnings. Leave them in your ~/Library/Fonts.bak folder and wait until this bug is possibly fixed by some root cause...
Only deleting all my preferences from `rm -rf ~/Library/Preferences/GoLand201*` worked!
I tried all of the above including suggestions from comments, and CLion (2019.3 and 2020.1) still crash like mad on macOS Catalina.
I do have one observation that might help:
I upgraded from an older MacBook Air to a 2020 MacBook Air. The new one is quad-core, eight-thread, and is a gen10 Ice Lake chip. On the old machine it didn't crash. Same version of Catalina.
That makes me suspect threading somehow since the new machine is so much more multithreaded (twice the concurrency). I have many times seen threading bugs that only manifest when more cores are added. Other possibilities include mis-detection of CPU features on the Ice Lake core by the JVM and generation of unsupported instructions, and a difference due to the newer version of the Intel Iris Plus on-die GPU. Lastly it's possible that this new GPU's driver for MacOS has a bug that is only being triggered by this specific application.
I did run a CPU, RAM, and GPU burn-in test for several hours on the new machine to rule out a hardware issue, and nothing else crashes.
Adam Ierymenko do you have exactly the same stacks in the crash dumps as in this issue? Does it always crash with the same stack?
Here's a crash report: https://pastebin.com/wcMGgDhG
This one didn't generate a JVM dump file. Sometimes it does.
I can also continue to confirm that nothing else crashes on this machine, including Visual Studio Code running clangd, Parallels VMs, and other heavy stuff.
I see a clue in the "illegal instruction" trap. This machine has, as I said, a new Gen10 Ice Lake core. I wonder if the JVM is mis-identifying the CPU in some way and generating e.g. vector instructions that it thinks are supported but are not.
Looks like https://youtrack.jetbrains.com/issue/IDEA-237181.
Deleting FindBugs plug-in from ~/Library/Application Support/JetBrains/IntelliJIdea2020.1/plugins should help.
This is CLion, and I don't see a FindBugs plugin. I just commented here because this bug report looked similar and they're all based on IntelliJ IDEA.
What I am experiencing sounds like this, but I have performed extensive CPU and RAM tests on this machine and have run lots of other programs with absolutely zero issues.
Check this link for the possibly related reports.
I had an actual MacOS crash from this!
At this point I very strongly suspect a Catalina bug in the GPU driver for the new version of the Intel Iris Plus graphics in the 2020 MacBook Air (Ice Lake SOC core). I suspect there's a bug in the driver that only CLion is triggering, because I have used this computer now for weeks and nothing else crashes or causes the system to crash.
I have forwarded to Apple. This rev of Catalina has been problematic, so I am going to wait for the next update. In the meantime you may want to investigate if anyone has a 2020 Air.
I've experienced similar issues to Adam on my 2020 MacBook Air. Multiple MacOS crashes a day, usually when using IntelliJ and screen sharing with Zoom.
Yes, and it's only the 2020 Air. Doesn't happen with other team members on a 2018 Pro or a 2019 Air with the same Jetbrains version and the same Catalina version.
I'd say it must be one of:
(1) Something triggering a GPU driver or other video bug that nothing else seems to trigger.
(2) It's mis-characterizing the processor and emitting invalid instructions. This still should not be able to crash the OS though, so I lean toward (1).
So I ran a CPU and RAM burn-in test for hours on this machine, and some GPU tests, and I'm about 100% convinced it's not a hardware issue. It's some kind of Catalina bug that only Jetbrains JVM is triggering (so far).
I have another thought:
I noticed another very strange bug. When CLion is full screen, tooltips pop up on different screens from the one it's on! It's like it's always watching the cursor position and pops up tooltips regardless of whether it has focus or is even on the same display.
I've heard online reports of this issue while screen sharing, so I'm wondering if it could be related. In any case the tooltip bug is very annoying.
BUMP!
I really miss CLion. VSCode just isn't as good for complex C++ development, though I can make do. If anyone at Jetbrains can find any workaround at all I'd very much appreciate it.
I've also made a bug report through the best channels available to Apple. The fact that it sometimes brings down the whole machine proves it's an Apple bug at the very least, but it could also be a Jetbrains/JVM bug as well. Bugs triggering bugs is not uncommon!
Please report at https://youtrack.jetbrains.com/newIssue?project=JBR with all the crash dumps attached.
Having the same problem as Adam. On a 2020 MacBook Air the IDE crashes randomly, which causes Mac OS to freeze, which then causes the machine to restart.
I am having the exact same problem. I tried the VM mentioned above and the fonts are just horrible. Also Macbook Air 2020 and IntelliJ Ultimate