| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a8ae440 commit d5b47d2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,25 +4,33 @@ const assert = require('assert'); | |||
| 4 | 4 | const { spawnSyncAndExit } = require('./child_process'); | |
| 5 | 5 | ||
| 6 | 6 | // Work around a pre-existing inspector issue: if the debuggee exits too quickly | |
| 7 | - // the inspector can segfault while tearing down. For now normalize the segfault | ||
| 7 | + // the inspector can crash while tearing down. For now normalize the crash | ||
| 8 | 8 | // back to the expected terminal event (e.g. "completed" or "miss") | |
| 9 | 9 | // until the upstream bug is fixed. | |
| 10 | 10 | // See https://github.com/nodejs/node/issues/62765 | |
| 11 | 11 | // https://github.com/nodejs/node/issues/58245 | |
| 12 | + // The crash shows up as with exit code 3221225477 on Windows, or signal | ||
| 13 | + // SIGSEGV on other platforms. | ||
| 12 | 14 | const probeTargetExitSignal = 'SIGSEGV'; | |
| 15 | + // 0xC0000005 STATUS_ACCESS_VIOLATION on Windows | ||
| 16 | + const probeTargetExitCode = 3221225477; | ||
| 13 | 17 | ||
| 14 | 18 | function isProbeSegvTeardown(result) { | |
| 15 | 19 | if (result?.event !== 'error') { return false; } | |
| 16 | 20 | const error = result.error; | |
| 17 | - if (error?.signal !== probeTargetExitSignal) { return false; } | ||
| 21 | + if (error?.signal !== probeTargetExitSignal && error?.exitCode !== probeTargetExitCode) { return false; } | ||
| 18 | 22 | return error.code === 'probe_target_exit' || error.code === 'probe_failure'; | |
| 19 | 23 | } | |
| 20 | 24 | ||
| 21 | 25 | function findProbeSegvTeardownLine(output) { | |
| 22 | 26 | const signalPrefix = `Target exited with signal ${probeTargetExitSignal}`; | |
| 23 | - if (output.startsWith(signalPrefix)) { return 0; } | ||
| 24 | - const idx = output.indexOf(`\n${signalPrefix}`); | ||
| 25 | - return idx === -1 ? -1 : idx + 1; | ||
| 27 | + const codePrefix = `Target exited with code ${probeTargetExitCode}`; | ||
| 28 | + for (const prefix of [signalPrefix, codePrefix]) { | ||
| 29 | + if (output.startsWith(prefix)) { return 0; } | ||
| 30 | + const idx = output.indexOf(`\n${prefix}`); | ||
| 31 | + if (idx !== -1) { return idx + 1; } | ||
| 32 | + } | ||
| 33 | + return -1; | ||
| 26 | 34 | } | |
| 27 | 35 | ||
| 28 | 36 | // Replace volatile fields in a probe report (stack frames, Node.js version, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments