From 20f4b6d8f910adb5a3739dce5f4ffcfd2eb491c4 Mon Sep 17 00:00:00 2001 From: Nicolas Hillegeer Date: Thu, 8 Feb 2024 08:56:33 -0800 Subject: runtime: call traceAdvance before exiting This ensures the trace buffers are as up-to-date as possible right before crashing. It increases the chance of finding the culprit for the crash when looking at core dumps, e.g. if slowness is the cause for the crash (monitor kills process). Fixes #65319. Change-Id: Iaf5551911b3b3b01ba65cb8749cf62a411e02d9c Reviewed-on: https://go-review.googlesource.com/c/go/+/562616 Auto-Submit: Michael Knyszek LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- src/runtime/trace.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/runtime/trace.go') diff --git a/src/runtime/trace.go b/src/runtime/trace.go index a9cfa22337..948a8da0ca 100644 --- a/src/runtime/trace.go +++ b/src/runtime/trace.go @@ -578,6 +578,9 @@ func StopTrace() { }) } +// traceAdvance is called from panic, it does nothing for the legacy tracer. +func traceAdvance(stopTrace bool) {} + // ReadTrace returns the next chunk of binary tracing data, blocking until data // is available. If tracing is turned off and all the data accumulated while it // was on has been returned, ReadTrace returns nil. The caller must copy the -- cgit v1.3-5-g9baa