-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
src: shutdown libuv before exit() #35021
Conversation
We should fast track this. It also needs to be backported to 14.x and 12.x. haven't tried 10.x but likely there too. |
I'll investigate shortly why it's failing on windows |
Ok... well... the failure on windows is still a segfault in the openssl I instrumented with some printf statements... here's what I'm seeing:
The
Now, that said, it does appear to segfault occasionally after
|
Ok, there are two distinct failure patterns that I'm seeing here: Segfault sometime after the Segfault sometime after the |
I'm attempting to do a debug build on windows now. It's going to take a while and I'm not sure if it's going to build successfully. The last time I tried a debug build on windows it failed.... |
Ok, libuv PR open here: libuv/libuv#2983 This PR should also land but the libuv fix will be necessary for the test case here to pass on windows. @addaleax, we can keep this PR open until we get the libuv fix, or, we can perhaps move the test into the known_issues set and get this landed now. Once the libuv fix lands here, we can move the test back into parallel. What do you think? |
The problem with that is that it will not crash reliably anywhere, and currently only does so on Windows… we could just skip the test on Windows if you like, and undo that when the libuv fix lands? Does that sound okay? (If yes, please push to this branch directly, I’ll be away for ~24 hours :)) |
Yeah that sounds good. I'll push that in the morning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Landed in e326c41 |
This ensures that no operations will be running on the libuv threadpool, which is important because they may run into race conditions with the global destructors being triggered from `exit()`, such as in the added test example here. PR-URL: nodejs#35021 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This ensures that no operations will be running on the libuv threadpool, which is important because they may run into race conditions with the global destructors being triggered from `exit()`, such as in the added test example here. PR-URL: #35021 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This ensures that no operations will be running on the libuv threadpool, which is important because they may run into race conditions with the global destructors being triggered from `exit()`, such as in the added test example here. PR-URL: #35021 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This ensures that no operations will be running on the libuv threadpool, which is important because they may run into race conditions with the global destructors being triggered from `exit()`, such as in the added test example here. PR-URL: #35021 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This ensures that no operations will be running on the libuv threadpool, which is important because they may run into race conditions with the global destructors being triggered from `exit()`, such as in the added test example here. PR-URL: nodejs#35021 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Fixes: libuv#2980 Refs: nodejs/node#35021 Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #2980 Refs: nodejs/node#35021 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Fixes: libuv#2980 Refs: nodejs/node#35021 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
This ensures that no operations will be running on the libuv
threadpool, which is important because they may run into race
conditions with the global destructors being triggered from
exit()
, such as in the added test example here.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes