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.

12 comments
Comment actions Permalink

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

Edited by Jeremie Lachkar
1
Comment actions Permalink

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".

0
Comment actions Permalink

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 ...

0
Comment actions Permalink

Try running PhpStorm from the Terminal to see which JDK is chosen and why:

export IDEA_LAUNCHER_DEBUG=true
/Applications/PhpStorm.app/Contents/MacOS/phpstorm
0
Comment actions Permalink

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

0
Comment actions Permalink

Please submit a ticket to support with the logs directory attached so that we can investigate it further.

0
Comment actions Permalink

Sorry that was my fault, thank you this workaround works !! :) 

0
Comment actions Permalink

Thanks for the workaround, its not crashing (that often) now. 

Crashing alot while: copy/paste file to a folder / having power safe mode off

0
Comment actions Permalink

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`

 

Edited by Stuartro
0
Comment actions Permalink

@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.

0
Comment actions Permalink

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:

  • IntelliJ IDEA 2019.2.1, build IC-192.6262.58
  • jbrsdk-11_0_3-osx-x64-b347
  • macOS 10.15 Beta (19A536g)

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

Edited by Paul Cantrell
0
Comment actions Permalink

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...

0

Please sign in to leave a comment.

Have more questions?

Submit a request