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 with empty artwork file mask #1079
Comments
Comment #1 originally posted by Alexey-Yakovenko on 2014-08-18T13:44:56.000Z: Great, thanks for the detailed description, etc, but wouldn't it have been easier to just submit a patch? :) |
Comment #2 originally posted by Alexey-Yakovenko on 2014-08-18T15:16:25.000Z: I will at some point, but if it is an immediate problem then I have an immediate solution. Do you think resetting a blank mask to the default makes sense? An empty mask is almost equivalent to setting the checkbox off. An empty mask actually still searches for *.jpg and *.jpeg, but that isn't obvious to the users. |
Comment #3 originally posted by Alexey-Yakovenko on 2014-08-18T19:52:06.000Z: Hey, attachments allowed again. Make my day! Here's a quick patch to fix the crash. Still lots of ideas:
Also spotted a possible (well, pretty certain, but not tested yet) memory leak in the file globbing code. The individual array strings from scandir are freed but not the array itself. Will add a fix to my development version. |
Comment #4 originally posted by Alexey-Yakovenko on 2014-08-18T20:29:23.000Z: I forgot to mention ideas for cache cleanup ... When artwork is unavailable, an empty directory is still created. Might become moot if unavailable artwork needs to be tracked to avoid too many lookups. Even invalidated cache files still remain on disk forever. No imminent nightmare, but they should probably be culled when they're thoroughly expired. Would probably need to be done on a separate thread, slowly. |
Comment #5 originally posted by Alexey-Yakovenko on 2014-08-18T20:34:07.000Z: This will have to become a sort of garbage collector. Or just add an explicit button to delete all expired files, with a progress bar. A topic for a separate bug/request though. Closing this one, the patch is merged. |
Original issue 1177 created by Alexey-Yakovenko on 2014-08-18T13:34:25.000Z:
What steps will reproduce the problem?
Какие шаги приводят к воспроизведению
проблемы?
What is the expected output? What do you see instead?
Какой ожидаемый вывод? Что вы видите
вместо него?
Eventually will crash
What version of the product are you using? On what operating system and CPU
architecture?
Какую версию продукта вы используете? На
какой операционной системе и
архитектуре CPU?
0.6.2
Crunchbang Linux
Pentium 4
How did you install the product?
Как вы установили продукт?
Static build
Please provide any additional information below.
Пожалуйста, предоставьте любую
дополнительную информацию ниже.
This is caused by files_count being uninitialised when declared. If the file mask is empty then the custom filter scandir is never called and files_count is still uninitialised. If files_count is not zero then the jpeg mask is never called and the dirent files array is referenced even though it is still NULL (or worse!).
The fix is trivial, just set files_count to zero when declared. I've done this in my working copy along with some other fixes, but maybe this should be released immediately? Or slightly more fancy, set the mask to the default if it is empty?
The text was updated successfully, but these errors were encountered: