Commit d6df9be
committed
src/node_errors: add re-entrancy guard to prevent infinite recursion in TriggerUncaughtException
Add a thread_local re-entrancy guard to TriggerUncaughtException()
that detects when the JS-level exception handler (process._fatalException)
itself triggers another exception through the inspector protocol.
This prevents the infinite loop:
TriggerUncaughtException -> InspectorConsoleCall ->
TriggerUncaughtException -> InspectorConsoleCall -> ...
When re-entrancy is detected, the function prints a diagnostic to
stderr, reports the fatal exception with kDontEnhance (to bypass the
inspector path), and aborts the process.
Fixes: #643261 parent 6adfff9 commit d6df9be
1 file changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
1278 | 1279 | | |
1279 | 1280 | | |
1280 | 1281 | | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1281 | 1312 | | |
1282 | 1313 | | |
1283 | 1314 | | |
| |||
0 commit comments