corruption of ui and segfaults while scrolling rapidly
Ckath opened this issue · comments
possibly related to #3, though it also happens when loading is well and done. it seems most reproducible when scrolling over audio files(using mediainfo without exiftool) but can also happen at random. sometimes its fixable with an R
, other times the entire terminal requires a restart. this might be related to the shoddily implemented ext_kill:
Lines 13 to 31 in 2f9e773
which might conflict with some programs the preview script runs, will need further looking into to find the actual cause of this happening. another possibility is the threading model(killing and joining threads rapidly) is too stupid to work.
extending this issue to also include the random segfaults which are probably related, the following things cause segfaults at random:
- opening a directory
- going back a directory
- scrolling fast
- scrolling slow
- breathing
possible fix in cbdf2f1, stop preview and refresh from executing at the same time, which might be corrupting the ncurses buffer
great progress has been made rewriting the way the preview thread is handled in e351c9f, assuming lack of thread safety and improper managing of threads is the main cause of all these issues, load_items
will be rewritten in similar fashion.
furthermore a seperate ext lib will be made wrapping ncurses functions in their own mutex to avoid ruining its window buffer
the current corruptionfixing
branch as of da1978b is looking very promising, I debugged further after the threading rework and without all the hanging due to threads there were a lot of lstat
hangs on my nfs shares so I moved everything to inmemory item array. I cant notice a huge increase in memory usage even with 80K item dirs, and this means I no longer have to stat each selected item, this only happens once during loading now.
hopefully after some further use and merging it it will mostly fix this issue