• Dmitriy Vyukov's avatar
    runtime: fix deadlock when gctrace · a0dbbeae
    Dmitriy Vyukov authored
    Calling ReadMemStats which does stoptheworld on m0 holding locks
    was not a good idea.
    Stoptheworld holding locks is a recipe for deadlocks (added check for this).
    Stoptheworld on g0 may or may not work (added check for this as well).
    As far as I understand scavenger will print incorrect numbers now,
    as stack usage is not subtracted from heap. But it's better than deadlocking.
    
    LGTM=khr
    R=golang-codereviews, rsc, khr
    CC=golang-codereviews, rlh
    https://golang.org/cl/124670043
    a0dbbeae
malloc.go 15.7 KB