diff options
Diffstat (limited to 'src/runtime/panic.go')
| -rw-r--r-- | src/runtime/panic.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go index e6d1c5d908..99eb1c3e23 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -759,6 +759,16 @@ func gopanic(e any) { fn() } + // If we're tracing, flush the current generation to make the trace more + // readable. + // + // TODO(aktau): Handle a panic from within traceAdvance more gracefully. + // Currently it would hang. Not handled now because it is very unlikely, and + // already unrecoverable. + if traceEnabled() { + traceAdvance(false) + } + // ran out of deferred calls - old-school panic now // Because it is unsafe to call arbitrary user code after freezing // the world, we call preprintpanics to invoke all necessary Error |
