Closed timotheecour closed 5 years ago
I've been trying to diagnose this - unfortunately it seems to have appeared with one of the more recent builds of Sublime Text.
/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 https://github.com/nim-lang/Nim/pull/8213
/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 https://github.com/nim-lang/nimsuggest/issues/83
that's progress!
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
@timotheecour thank you, a lifesaver
closing since https://github.com/nim-lang/nimsuggest/issues/83 seems fixed now
re-opening because of a new case that causes the crash: https://github.com/nim-lang/Nim/issues/9610
ok that bug was fixed; but to prevent future similar bugs, how about following:
nim fix
if it crashes (and write to a log so we don't ignore)/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
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"