• Dmitriy Vyukov's avatar
    runtime: don't lock mheap on user goroutine · e91704af
    Dmitriy Vyukov authored
    This is bad for 2 reasons:
    1. if the code under lock ever grows stack,
    it will deadlock as stack growing acquires mheap lock.
    2. It currently deadlocks with SetCPUProfileRate:
    scavenger locks mheap, receives prof signal and tries to lock prof lock;
    meanwhile SetCPUProfileRate locks prof lock and tries to grow stack
    (presumably in runtime.unlock->futexwakeup). Boom.
    Let's assume that it
    Fixes #8407.
    
    LGTM=rsc
    R=golang-codereviews, rsc
    CC=golang-codereviews, khr
    https://golang.org/cl/112640043
    e91704af
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...