-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Panic when using modules that loaded with exception #1257
Comments
@zzamboni, You should be a test engineer. Note that your reproduction only affects interactive shells. The non-interactive equivalent behaves as expected; i.e., no panic.
TBD is why the interactive context mutates the global list of namespaces to include an invalid module while the non-interactive context does not. |
@krader1961 interesting. With an example like yours, it indeed does not crash:
However, if I don't use
|
Hmm, the behavior is specific to interactive shells because a failed import would cause an exception and abort the surrounding block. In non-interactive cases this would normally cause the surrounding namespace to become inaccessible, so the broken variable doesn't matter (unless the exception is swallowed by I'll need to think a bit about how to best handle this. |
I spent a couple of hours using my (unmerged) trace package to understand the dynamics of this unexpected behavior in the hope I could identify an obvious fix. I failed to find a simple fix. It's not clear this should be a blocking bug for the next point release. All bugs should be fixed ASAP but this is primarily a UI bug that few people (close to zero in my estimation) will ever notice. |
Not entirely sure if relevant, but I can trigger a crash in the same function (
Use the up arrow key twice to cycle back to the "str:split" command. I can reliably reproduce a SIGSEGV panic with the following backtrace on df3e7a9:
|
I can reproduce the panic described by @Xjs.
|
I found a new (?) way to crash elvish. I think it might have the same underlying cause as the present issue, so I post it here instead of opening a new one. To reproduce, follow this transcript:
That
|
Initialization of variable slots were "hoisted" to the beginning of each scope. This commit moves that initialization to the command that declares the variable, which make it easier to resolve #1257 and #1235. Also properly handle variables that are created as part of a temporary assignment, addressing #532. There are some failing tests, which will be fixed in upcoming commits.
If a
use
d module contains an error, Elvish crashes upon any attempt at accessing its namespace.For example, if
~/.elvish/lib/test.elv
contains the following:Then:
Now I type
test:
followed byt
(any other key works too), Elvish panics the moment I type the key following the colon:Trying again, now I type
test:
followed by Tab, which produces a longer backtrace:The text was updated successfully, but these errors were encountered: