src: add re-entrancy guard to TriggerUncaughtException · nodejs/node@2fd50ae · GitHub
Skip to content

Commit 2fd50ae

Browse files
themuulnaduh95
authored andcommitted
src: add re-entrancy guard to TriggerUncaughtException
Add a thread_local re-entrancy guard to TriggerUncaughtException() that detects when the JS-level exception handler (process._fatalException) 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 with the formatted exception to stderr using FormatCaughtException (which avoids the inspector path entirely), then aborts the process. Fixes: #64326 Signed-off-by: Temuulen Undrakhbayar <zerone.offical@gmail.com> PR-URL: #64327 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent dfe0617 commit 2fd50ae

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎src/node_errors.cc‎

Lines changed: 23 additions & 0 deletions

0 commit comments

Comments
 (0)