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
Crash when creating and reading local variable concurrently #754
Comments
Aha, you found a concurrency bug. This is happening because we use maps for scopes in Elvish, and since pipelines are executed in parallel, this line will both read and write to the scope:
The read comes from I have failed to construct a smallest reproduction though. This code should trigger the same crash, but I haven't succeeded yet:
|
Meanwhile, you can workaround the problem by moving the output construct up one level: edit:location:matcher = [pattern]{
input = []
each [in]{ input = [ $@input $in ] }
output = [(for i $input {
print $i"\x00"
}| fzf --read0 -f $pattern)]
for i $input {
has-value $output $i
}
} Also, you can use edit:location:matcher = [pattern]{
@input = (all)
@output = (for i $input { print $i"\x00" }| fzf --read0 -f $pattern)
for i $input {
has-value $output $i
}
} |
The test now fails with "go test -race".
I don't have a reproduction locally, but at least I have a test that now fails when run with |
I believe this issue was fixed in 8c71635. Since I haven't been able to reproduce this locally and can't verify it, please reopen if this still reproduces. |
I added the following to my
rc.elv
(it usesfzf
for directory history matching):Crash happens randomly. Probably when multiple
fzf
instances are running (I have a slow CPU).OS: Void Linux
glibc
, but it also happens on Arch Linux (bothx86_64
).Version (on Void):
Backtrace:
The text was updated successfully, but these errors were encountered: