This repository has been archived by the owner on May 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
linux: fix 'two watchers, one path' segfault
Problem: registering two uv_fs_event_t watchers for the same path, then closing them, caused a segmentation fault. While active, the watchers didn't work right either, only one would receive events. Cause: each watcher has a wd (watch descriptor) that's used as its key in a binary tree. When you call inotify_watch_add() twice with the same path, the second call doesn't return a new wd - it returns the existing one. That in turn resulted in the first handle getting ousted from the binary tree, leaving dangling pointers. This commit addresses that by storing the watchers in a queue and storing the queue in the binary tree instead of storing the watchers directly in the tree. Fixes nodejs/node-v0.x-archive#3789.
- Loading branch information
1 parent
ec76a42
commit 4fe1916
Showing
3 changed files
with
77 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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