-
Notifications
You must be signed in to change notification settings - Fork 69
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
Recover gracefully from corrupted cache situations #71
Comments
A related issue and the root cause of the crash is that the cache loading process corrupts the memory when invalid cache is encountered and it may not be good enough to simply retry. This happens because It also seems that the reader of the shas does not check bound and simply forward the pointer by 41 bytes every cycle. A bounds check should probably be added... |
Avoid corrupting memory by clearing the cache before freeing it's content. Also adds a bounds check on the sha array. Fix tibirna#69 Fix tibirna#71
And just for the reference, the cause for my corrupted cache file may be openning multiple qgit on the same checkout at the same time, or using complex options to filter the commits ( In this case, the fresh cache file is 4.1kB whereas the old one was 1.8MB so the currupted one is clearly not just truncated. |
If the cache file (
.git/qgit_cache.dat
) gets corrupted in some way (e.g. file truncated or crash in the middle of saving it), qgit can't be started anymore on the affected repository, crashing in the cache reading process.TODO: wrap all cache process in a
try...catch...
and simply reconstruct cache on any error. If recovery process fails, forego use of cache and inform user for further investigation.Related issue: #69
The text was updated successfully, but these errors were encountered: