Ever been excited to dig into your Markdown files or preview an SVG in IntelliJ, only to be frustrated by unexpected crashes? If you’ve found yourself trapped in an endless loop of IntelliJ reopening the exact files that triggered the crash, you’re not alone.

In this blog post, we’ll investigate a common cause behind the IntelliJ crash cycle when handling Markdown and SVG files and – most importantly – discover how to conquer this vexing issue. Let’s dive right in!

At first, I suspected that the problem originated with the Markdown plugin. Enabling this seemingly innocent plugin and opening any project with README.md files is enough to reproduce this pesky error.

For a while, I managed to make peace with the situation by opting for the simplest fix: disabling the Markdown plugin. It didn’t bother me, until the problem resurfaced with SVG files – even with plugins disabled. This time, I was determined to find the root cause. Upon investigating IntelliJ logs, I stumbled upon this revealing snippet:

2023-11-30 09:06:23,509 [   4556]   WARN - #c.i.e.t.TargetBasedSdks - SDK target configuration data is absent
 
Info  | RdCoroutineScope      	| 15:DefaultDispatcher-worker-4 | RdCoroutineHost overridden

[1130/090626.667615:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/mkresic/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate-2/jbr/lib/chrome-sandbox is owned by root and has mode 4755.

The culprit? chrome-sandbox. In IntelliJ, chrome-sandbox serves as a security feature for executing JavaScript code securely within the integrated web browser. Acting as a protective barrier, it ensures a secure environment for web-related tasks, particularly when using developer tools in the domain of web development and integrated tools.

Regardless of whether you have IntelliJ installed via the Toolbox app or any other method, the logic remains the same. The solution, as hinted in the log, involves checking and adjusting the permissions of the chrome-sandbox file.

➜  ~ ll ~/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate-2/jbr/lib/chrome-sandbox
-rwxr-xr-x 1 mkresic:mkresic 229K sij  20  1970 /home/mkresic/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate-2/jbr/lib/chrome-sandbox

➜  ~ sudo chown root:root ~/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate-2/jbr/lib/chrome-sandbox

➜  ~ sudo chmod 4755 ~/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate-2/jbr/lib/chrome-sandbox

And just like that, IntelliJ no longer crashes. The error message output by the IntelliJ logs gives us precisely the fix for this crash loop problem – and now, I can use my Markdown plugin again!