-
Notifications
You must be signed in to change notification settings - Fork 320
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
Potential crash when sorting files in a directory #1200
Comments
I managed to produce the crash again on version
BTW I have found that it's convenient to redirect stderr to a file so that the stack trace can be viewed easily: lf 2> ~/lf.log |
@joelim-work Your proposed change sounds reasonable to me. We can change it and try it for a while if you want. Is there a way to reproduce the crash in a consistent manner? |
@gokcehan I first noticed this crashing behaviour when I was using the
I can consistently reproduce this crash on my machine by using it to select a very large directory, but because the crashing behaviour depends on goroutine scheduling and the filesystem, I don't know how easy it is for others to reproduce. I have created a pull request #1204, which fixes the issue for me, and hopefully others as well. |
When a directory is loaded but the settings for displaying files are modified, the following code is run:
lf/nav.go
Lines 473 to 477 in 83af3e1
This code looks very suspicious to me because it accesses and sorts
dir.files
in a different goroutine, when normally this is manipulated by the main thread. I suspect this is what causeslf
to crash as reported in #502, and I have also experienced crashing when I was playing around with thedironly
option.I was thinking that this could be solved by simply creating a copy for the goroutine like below:
But since this is hard to prove and I'm not 100% certain, I'm raising this as an issue first.
The text was updated successfully, but these errors were encountered: