• Michael Anthony Knyszek's avatar
    runtime: avoid write barrier in startpanic_m · 9ed9df6c
    Michael Anthony Knyszek authored
    startpanic_m could be called correctly in a context where there's a
    valid G, a valid M, but no P, for example in a signal handler which
    panics. Currently, startpanic_m has write barriers enabled because
    write barriers are permitted if a G's M is dying. However, all the
    current write barrier implementations assume the current G has a P.
    
    Therefore, in this change we disable write barriers in startpanic_m,
    remove the only pointer write which clears g.writebuf, and fix up gwrite
    to ignore the writebuf if the current G's M is dying, rather than
    relying on it being nil in the dying case.
    
    Fixes #26575.
    
    Change-Id: I9b29e6b9edf00d8e99ffc71770c287142ebae086
    Reviewed-on: https://go-review.googlesource.com/c/154837
    Run-TryBot: Michael Knyszek <mknyszek@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    9ed9df6c
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...