You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In one of the projects I have test which involves many watchers, and some race condition occurs.
Occasionally (let's say once per three times) test crashes with Segmentation fault: 11
@indutny you need OSX, and then just follow steps indicated in description. It's important to note that it doesn't happen on every run (let's say 1 per 3 runs), so if it's not exposed by first test run, try again, you'll definitely get it.
I was trying to prepare something smaller, but it doesn't seem easy to do, it's clear that it happens only in some race condition scenarios, and there are a lot file changes going on in test.
Activity
evanlucas commentedon Dec 1, 2015
I was able to reproduce.
Looks to be an issue with fsevents?
yjhjstz commentedon Dec 1, 2015
It's an issue with fsevents. How to reproduce? @evanlucas
bnoordhuis commentedon Dec 1, 2015
/cc @indutny - he wrote most of libuv's fsevents code.
indutny commentedon Dec 1, 2015
I will take a look at this, but I need a test case. @evanlucas could you please share it with me?
medikoo commentedon Dec 1, 2015
@indutny you need OSX, and then just follow steps indicated in description. It's important to note that it doesn't happen on every run (let's say 1 per 3 runs), so if it's not exposed by first test run, try again, you'll definitely get it.
I was trying to prepare something smaller, but it doesn't seem easy to do, it's clear that it happens only in some race condition scenarios, and there are a lot file changes going on in test.
indutny commentedon Dec 1, 2015
The problem happens in
uv__fsevents_reschedulewhen it tries to dostate = handle->loop->cf_state;. TheloopisNULL, so it crashes.indutny commentedon Dec 1, 2015
Will look more into it.
indutny commentedon Dec 2, 2015
Strictly speaking
handleis a total garbage:indutny commentedon Dec 2, 2015
@medikoo may I ask you to give a try to the following patch?
indutny commentedon Dec 2, 2015
Appears to be working fine for me so far...
indutny commentedon Dec 2, 2015
Got to say, that if it will fix this - you have hit a pretty unexpected edge case! :) Good job.
medikoo commentedon Dec 2, 2015
@indutny works great, I gave it a dozen of runs with even more tests involved, and no crash was observed. Great thanks!
Will this fix also be ported to LTS 4.2?
indutny commentedon Dec 2, 2015
@medikoo definitely. Though, I will need to create a test case for libuv first ;)
fsevents: fix race on simultaneous init+close
indutny commentedon Dec 2, 2015
Looks like the test is already in libuv, filed a PR: libuv/libuv#637
medikoo commentedon Dec 2, 2015
👍
fsevents: fix race on simultaneous init+close
bo01ean commentedon Dec 16, 2015
I think I have this one too. I am wrapping my node process with pm2 so it will just respawn.
Is there instructions to recompile somewhere so I can verify?
indutny commentedon Dec 16, 2015
@bo01ean definitely! The fix has been already landed in master, so if you could just:
./configure && make -j9in thenodefolder/path/to/node/folder/out/Release/nodeindutny commentedon Dec 24, 2015
Have we updated libuv already? cc @evanlucas do we need to backport this to LTS?
evanlucas commentedon Dec 24, 2015
I'm not sure that LTS has had it back ported. Will check tomorrow and see.
evanlucas commentedon Dec 29, 2015
It looks like Argon is still using libuv@1.7.5 (4c59407) so I would think it would need backporting.
evanlucas commentedon Feb 8, 2016
This should have been fixed in v4.2.5 and v5.3.0. Thanks!