• David du Colombier's avatar
    runtime: don't use FP when calling nextSample in the Plan 9 sighandler · 31430bda
    David du Colombier authored
    In the Go signal handler on Plan 9, when a signal with
    the _SigThrow flag is received, we call startpanic before
    printing the stack trace.
    
    The startpanic function calls systemstack which calls
    startpanic_m. In the startpanic_m function, we call
    allocmcache to allocate _g_.m.mcache. The problem is
    that allocmcache calls nextSample, which does a floating
    point operation to return a sampling point for heap profiling.
    
    However, Plan 9 doesn't support floating point in the
    signal handler.
    
    This change adds a new function nextSampleNoFP, only
    called when in the Plan 9 signal handler, which is
    similar to nextSample, but avoids floating point.
    
    Change-Id: Iaa30437aa0f7c8c84d40afbab7567ad3bd5ea2de
    Reviewed-on: https://go-review.googlesource.com/16307Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    31430bda
malloc.go 30.5 KB