src: disconnect inspector before exiting out of fatal exception#29611
src: disconnect inspector before exiting out of fatal exception#29611joyeecheung wants to merge 3 commits intonodejs:masterfrom
Conversation
So that coverage, .etc are properly written in case of a normal fatal exception.
1da18a1 to
83fc7ad
Compare
src/node_errors.cc
Outdated
|
|
||
| // Now we are certain that the exception is fatal. | ||
| ReportFatalException(env, error, message, EnhanceFatalException::kEnhance); | ||
| WaitForInspectorDisconnect(env); |
There was a problem hiding this comment.
I didn't leave this for other Exit() calls in TriggerUncaughtException() as those cases are more abnormal than this (e.g. the global uncaught exception handler throws itself, or the global hook is monkey-pached incorrectly) and I think it would unsafe to wait until the inspector shut down in those cases.
| // Now we are certain that the exception is fatal. | ||
| ReportFatalException(env, error, message, EnhanceFatalException::kEnhance); | ||
| #if HAVE_INSPECTOR | ||
| profiler::EndStartedProfilers(env); |
There was a problem hiding this comment.
Uh just realized we should call profiler::EndStartedProfilers instead since the whole WaitForInspectorDisconnect resets signals.
| @@ -0,0 +1,7 @@ | |||
| const a = 99; | |||
| if (true) { | |||
There was a problem hiding this comment.
This is in the test though?
bcoe
left a comment
There was a problem hiding this comment.
One little nit with regards to test name 😄
Thanks for digging into this, I thought it would be something obvious.
test/parallel/test-v8-coverage.js
Outdated
| assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); | ||
| } | ||
|
|
||
| // Outputs coverage when process.exit(1) exits process. |
There was a problem hiding this comment.
perhaps, change to:
// Outputs coverage when error is thrown in first tick.
There was a problem hiding this comment.
Uh thanks for catching my copy-past error :)
a85298b to
07c3ae3
Compare
|
@joyeecheung This is ready to land in your opinion? |
|
@Trott yes |
So that coverage, .etc are properly written in case of a normal fatal exception. PR-URL: nodejs#29611 Fixes: nodejs#29570 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com>
|
Landed in b263423 |
So that coverage, .etc are properly written in case of a normal
fatal exception.
Fixes: #29570
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes