Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Win32: add a cache below mingw's lstat and dirent implementations
fscache_clear was crashing because when using hashmap_iter_next method the next entry will be saved. Meanwhile the call to fscache_release will free the directory and the list of entries for the directory. This causes the next entry saved by the iter to be freed, invalid and the crash with the next loop iteration. This changes the clear to simple call hashmap_free to free the hashmap and all the entries and then call hashmap_init to reinitialize the hashmap for the next fscache use. The reason this is safe is fscache_clear is only called from fscache_enable when this cache is being disabled which is only called in preload_index after all the thread have exited. It is also guarded by the critical section mutex. Signed-off-by: Kevin Willford <kewillf@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
- Loading branch information
a36e14b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a crash for me on
git diff -- file
. Please release soon.a36e14b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orgads please test the latest snapshot: https://wingit.blob.core.windows.net/files/index.html
a36e14b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works.
a36e14b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2.13.1(2) was released, with this fix as only change relative to v2.13.1.
a36e14b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!