Commit 94fa671
fix(profiler): restore signal depth after longjmp unwinds segvHandler
longjmp() in checkFault() bypasses C++ destructors, leaving
_in_signal_handler_depth stuck at an inflated value after crash recovery.
When SIGSEGV fires inside walkVM (depth=1 from SIGPROF handler), segvHandler
increments depth to 2, then longjmp unwinds back to setjmp in walkVM
without running SignalHandlerScope::~SignalHandlerScope(). Explicitly
decrement depth at the longjmp recovery site to undo the skipped destructor.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 1d27f6e commit 94fa671
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
| |||
0 commit comments