Repository navigation
Fix rename directory segfault on linux - #63
Merged
Merged
Conversation
implausible
force-pushed
the
fix/rename-directory-eventual-segfault
branch
from
December 1, 2018 23:06
de52baa to
5c22f7b
Compare
Contributor
Author
|
Closes #62. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It looks like a move event can occur cross directories so long as we have a watch established in each location. This causes some strange linking behavior of the tree in linux land.
The pattern to cause the segfault is to have a directory structure like:
a/b/tod/b/.a/c/toa/b/.a.d.For some reason, this does not occur 100% of the time, though it was fairly deterministic on my home computer when running in GitKraken. The only way to get it to repro in node 6 and 8 was to cause several events that perform the same procedure. And for some reason node 10 seems resilient to the issue.
The proposed fix would be to improve the rename event in linux to support cross watched directory moves, and to include the new directory path with it. This will add an extra field
newDirectoryto the rename event. This would be backwards compatible with what we're currently reporting, but would also yield better rename details in linux.