0

After I updated to the last version of SublimeText3 (build 3176) the plugin_host started to crash every time that I select a tab with a PHP file.

plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

I thought maybe some extension could be the culprit but can't debug which one. I tried to put all the installed_packages to the ignored_packages in my Package Control.sublime-settings, but didn't help (actually I could still invoke plugin functions via the command palette; 🤔 but couldn't think of other ways to disable all extensions at once).

1 Answer 1

0

I managed to solve the problem in my case.

After update to the mot recent SublimeText version (3176), plugin_host was crashing each time that I switched to a tab containing a PHP file.*

I had no detail of the error or stack-trace so I could just guess.

In my case the issue was with the PHP-CS (Code Sniffer) extension of SublimeLinter, that was crashing. Removing it was preventing the crash. Couldn't find any related issue on the github repository so I assumed that the error was due to my local configuration rather than a bug in the code.

I checked the SublimeLinter configuration and saw that there was an entry to phpcs setting a specific path for the executable, rather than relying on the PATH system environment variable in order to find it.

I tried to run the configured path (in my case was /usr/local/opt/php/bin/phpcs) and verified that the (configured) executable was the one crashing (using echo $? revealed me the exit code 133).

So I tried to remove the SublimeLinter configuration relative to phpcs (making it rely on the system configuration for locating it), saved, restarted Sublime and voilà 🎉 it worked flawlessly without any more crash of plugin_host! The pointed phpcs was the wrong one and I needed to use the one found under the PATH env.

I suppose that either the _plugin_host_ or SublimeLinter assume that the called executables will work correctly once found at their location, or that they don't handle correctly the exit-status from the processes and provoke a bigger crash in some scope/context where the error is not caught and the stack-trace is not generated (hence, no useful info in the log over the console). I might be wrong on the diagnosis, but maybe this will help somebody else to track down the issue and find why these crashes happen instead of catching the exception 🙂

In general I'd suggest to:

  • look for the culprit among the plugins that call external executables
  • ensure that the paths are specified correctly, pointing to the correct version of the executable
  • ensure that the executable actually works outside of Sublime
2
  • 1
    Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
    – DavidPostill
    Commented Feb 15, 2019 at 20:40
  • Check. Learned my lesson. I'll add a comment on the other question, pointing to this one. Commented Feb 15, 2019 at 21:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .