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