-
Notifications
You must be signed in to change notification settings - Fork 30k
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 <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rich Trott <[email protected]>
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 <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rich Trott <[email protected]>
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 <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rich Trott <[email protected]>
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 <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rich Trott <[email protected]>
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 <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Fixes: libuv#2980 Refs: nodejs/node#35021 Signed-off-by: James M Snell <[email protected]>
Fixes: #2980 Refs: nodejs/node#35021 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jameson Nash <[email protected]>
Fixes: libuv#2980 Refs: nodejs/node#35021 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jameson Nash <[email protected]>
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