Sublime Forum

How to debug plugin_host has exited unexpectedly

#1

Im writing a plugin that does a heavy process of huge XML, sometimes (cannot determina when or why), I get the error: plugin_host has exited unexpectedly, plugin functionality won’t be available until Sublime Text has been restarted when opening one of these huge XML and the plugin start working.

How can I debug and get to the root of the exception that causes the plugin_host to crash?

Thanks,
A

1 Like

#2

It’s hard to tell which plugin it is, maybee turning off all your plugins and turn on one by one could help

0 Likes

#3

Thanks, Im pretty sure that my plugin is causing the crash, but I dont know why, is there a way to get a more verbose exception message when the plugin_host crashes?

Also, is there a way to not having to restart sublime everytime you change something in your plugin code that you want to verify?

Thanks,
A

0 Likes

#4

Assuming the plugin is at the top level of your package folder. It is reloaded on save. To prove this to yourself, open the ST console and save your plugin file. You should see a message similar to "reloading plugin "

0 Likes

#5

Yep, my plugin is in a directory on top of Packages folder, but evry time a change a python module and save it, its not reloaded, and no message appear in the console appart from the "Writing file … with encoding). Is this a new feature? Im using build 3059

Thanks,
A

0 Likes

#6

I found the answer to the reloading problem here: sublimetext.com/forum/viewt … =6&t=14171
It was related with the symlink to dropbox.

However, if someone knows how to debug a plugin_host crash, that question is still open :smiley:

0 Likes

#7

First thing I would do is trying reproduce the problem consistently and narrow down the function that causes the problem. In your case, it’s probably the loading process of the xml / the parsing of the file afterwards. Keep in mind that other plugins also try to do their stuff with the file (like linters, git gutter, etc), so it would be wise to try this in a clean environment to rule out “external influences”.

If you don’t mind to share your code and a test xml, I’ll be glad to help out

0 Likes

#8

Solved by:

  1. Closing sublime text
  2. Renaming %APPDATA% Sublime Text 3, to Sublime Text 3-old
  3. Uninstalled Sublime Text 3
  4. Deleted all Sublime Text 3 files/folders left in Program Files
  5. Cleaned registry using CCleaner (important)
  6. Restarted PC
  7. Installed Sublime Text 3 from new download
  8. Installed package manager
  9. Copied the files in my Sublime Text 3-old/Packages/User to the newly created Sublime Text 3/Packages/User folder

Problem solved here.

0 Likes

#9

I have the same issue but I don’t remember installing any plugins other than trying to install package control… what do I do in that case?

0 Likes