Skip to content

Fix rename directory segfault on linux - #63

Merged
implausible merged 4 commits into
masterfrom
fix/rename-directory-eventual-segfault
Dec 2, 2018
Merged

implausible merged 4 commits into
masterfrom
fix/rename-directory-eventual-segfault

Conversation

@implausible

@implausible implausible commented Dec 1, 2018 •

Copy link
Copy Markdown
Contributor

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/
----c/
--d/
  1. Move a/b/ to d/b/.
  2. Move a/c/ to a/b/.
  3. Delete a.
  4. Delete 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 newDirectory to the rename event. This would be backwards compatible with what we're currently reporting, but would also yield better rename details in linux.

@implausible
implausible force-pushed the fix/rename-directory-eventual-segfault branch from de52baa to 5c22f7b Compare December 1, 2018 23:06
@implausible

Copy link
Copy Markdown
Contributor Author

Closes #62.
Fixes #42, #33, and microsoft/vscode#37270.

@implausible
implausible merged commit 830c551 into master Dec 2, 2018
@implausible
implausible deleted the fix/rename-directory-eventual-segfault branch December 2, 2018 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant