Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"error: plugin_host has exited unexpectedly" #99

Closed
timotheecour opened this issue Jul 5, 2018 · 9 comments
Closed

"error: plugin_host has exited unexpectedly" #99

timotheecour opened this issue Jul 5, 2018 · 9 comments

Comments

@timotheecour
Copy link
Member

timotheecour commented Jul 5, 2018

I'm getting a lot of these "error: plugin_host has exited unexpectedly" when editing nim files ; probably nimsuggest failing and the plugin not properly handling errors

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

@Varriount
Copy link
Collaborator

I've been trying to diagnose this - unfortunately it seems to have appeared with one of the more recent builds of Sublime Text.

@timotheecour
Copy link
Member Author

timotheecour commented Jul 6, 2018

/cc @Varriount
do you have a reproducible test?
it's been occurring frequently recently ; didn't use to be the case, say 1 month ago IIRC (but i could be wrong) ; could be that the plugin crashes; could we perhaps wrap the entire plugin callback in a try/catch and log to some file when error occurs for debugging (eg: /tmp/NimLine.crash.log or better, configure that in sublime json config)

also, just curious, was that message sent by accident and then deleted on gitbhub? Doesn't os.nim export ospaths? in nim-lang/Nim#8213

@timotheecour
Copy link
Member Author

timotheecour commented Jul 10, 2018

/cc @Varriount looks like I found a reproducible test case. It always crashes with "error: plugin_host has exited unexpectedly" when I open this file and press command+S to save it.

Please let me know whether you can reproduce it on your end.

#[
# plugin_host bug: https://github.com/Varriount/NimLime/issues/99
open this in sublime text
when use saves this file (eg on OSX: via command + S), the plugin_host will die
seems like a minimal-ish test case: variations of this file won't trigger that bug (eg removing =0, commenting a line, removing {.strdefine.} etc)
]#

const testCase {.strdefine.}: string=0
when false: discard
elif testCase == "test1":

/cc @Varriount EDIT looks like the root cause is that nimsuggest crashes with SIGSEGV on this example; I just filed nim-lang/nimsuggest#83

that's progress!

@timotheecour
Copy link
Member Author

WORKAROUND:
set this as follows:
Packages/User/NimLime.sublime-settings

{
    "nim.executable": "",
}

obviously not a good workaround since it'd disable a lot of features of NimLine, but at least syntax highlighting for nim would still work

@alehander92
Copy link

@timotheecour thank you, a lifesaver

@timotheecour
Copy link
Member Author

closing since nim-lang/nimsuggest#83 seems fixed now

@timotheecour
Copy link
Member Author

re-opening because of a new case that causes the crash: nim-lang/Nim#9610

@timotheecour timotheecour reopened this Nov 3, 2018
@timotheecour
Copy link
Member Author

ok that bug was fixed; but to prevent future similar bugs, how about following:

  • restart the process that runs nim fix if it crashes (and write to a log so we don't ignore)

@timotheecour
Copy link
Member Author

timotheecour commented Nov 5, 2018

/cc @Varriount I found a great workaround:
install latest sublime dev channel https://www.sublimetext.com/3dev
this build: BUILD 3179 introduced this feature:

Mac: Fixed a plugin_host crash when running a process that itself crashes

and I verified it fixes this issue on OSX

so I'll close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants