-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Segmentation fault: 11 #219
Comments
I can reproduce, although interestingly it doesn't happen if The segfault is obviously coming from underlying C stuff in node core or fsevents, but I'll see what I can do to track it down. |
@es128 There is a node module you can require that provides better stacktraces for segfaults - that might give you a good head start |
It doesn't happen when using either io.js or node 0.11 |
Oh spoke too soon, I just got it to happen once with io.js (1.0.1), but that was like 1 of 10 attempts. I can make it happen pretty consistently with node 0.10 |
I've narrowed it down to fsevents, but I'd be out of my depth in trying to actually fix it. Hopefully the folks at strongloop will be able to pitch in, as they've recently agreed to take over maintenance of the fsevents module and are already responsible for its io.js compatibility: https://github.com/bajtos/fsevents/pull/1#issuecomment-70133793. |
I'm glad to see that (a) someone else has been seeing this and (b) that it might be getting worked on. I've seen the same errors with Gaze for months now, and it's pretty sporadic. Here's the stacktrace (the top entry is from the segfault-handler library):
i'm not totally sure how to interpret this, but it's at least a start. I should also note that I'm using both watchify and gulp-watch, and I get this segfault both when I use the old gulp-watch with gaze as well as the new gulp-watch with chokidar. |
@noahgrant you can track progress on this in the fsevents repo's issue/PR tracker. Very grateful that @bnoordhuis has been giving it some attention. Waiting on him to come up with a new patch (or rewrite) as the next step. Unless someone else comes along with the requisite expertise and desire to work on this seems like there is not much else that can be done in the meantime. |
Thanks, @es128! |
by the way, i should note that the above stack trace is from Gaze, not Chokidar, but also presents much less information than the one you posted, @es128, on the fsevents repo, which has two lines referencing I guess my point is that if I've seen it for both Gaze and Chokidar, only the latter of which uses fsevents, maybe fsevents isn't the issue? Maybe it's node core, from libuv? clarification: i don't actually know which one it's coming from (i'm using gaze from gulp-watch and chokidar from watchify), but it's not Gaze directly. If the null pointer bug causing this is from fsevents, then my stacktrace above should also be from chokidar. If it's from libuv/node core, then it's possible the stacktrace was from fs.watch/watchFile (and from Gaze indirectly) |
Yep that seems like a possibility, although I don't know enough to do much more than speculate. |
As a side note, I built https://github.com/mcollina/chokidar-child to work around this issue. It 100% solves it for me by spawning a child process for each watcher. This also helps a lot if you run multiple watcher instance from the same node process. |
@mcollina This prevents any crashes that are otherwise reproducible? Or the child process wrapper just recovers gracefully after a crash? If the former, why do you think running in a child process makes a difference? |
The child process wrapper recovers gracefully after a crash. Given that I was using some instances of the watcher to watch hundreds of files, the process wrapper solves my issues in two ways:
I am on Mac, and it is related to the fsevents bug. It makes chokidar working reliably for my particular use case, which was not before due to the segfault and the high number of watched files. |
Makes sense. Thanks for the insight. |
Thank you for maintaining this. |
Thanks for working on this. We are getting so close to releasing gulp4 |
@phated, just curious, how is gulp4 related to this? It looks like gulp4 is still using |
ahhh gotcha. awesome! |
If there's anyone who can help evaluate this - would be appreciated. |
This has likely been fixed for the described use-case (at least, vastly improved) with the release of fsevents@0.3.7. Closing for now, but will reopen if someone can demonstrate a realistic and reproducible case that still exhibits this problem. |
We've started seeing people experience this again today with the release node-sass@3.3.0. @es128 appears to be correct that this was resolved in My investigation is in sass/node-sass#1107 (comment) The segfaults stacktrace is
My system
|
I've opened an issue with fsevents (fsevents/fsevents#82). |
Reopening... although I don't think there's any immediate action to be taken here because unfortunately pinning chokidar to 0.3.7 would break io.js v3 compat. Working toward #318 remains attractive |
@es128 it looks like the linked issue has been resolved, has this also? |
@phated good point. We'll keep an eye out, but closing again for now. |
Test case:
rm -rf node_modules && npm install
Process will log
Segmentation fault: 11
and die. This happens to me all the time when using watchify, which uses chokidarThe text was updated successfully, but these errors were encountered: