• Austin Clements's avatar
    runtime: print gctrace before releasing worldsema · 1e1ea669
    Austin Clements authored
    Currently we drop worldsema and then print the gctrace. We did this so
    that if stderr is a pipe or a blocked terminal, blocking on printing
    the gctrace would not block another GC from starting. However, this is
    a bit of a fool's errand because a blocked runtime print will block
    the whole M/P, so after GOMAXPROCS GC cycles, the whole system will
    freeze. Furthermore, now this is much less of an issue because
    allocation will block indefinitely if it can't start a GC (whereas it
    used to be that allocation could run away). Finally, this allows
    another GC cycle to start while the previous cycle is printing the
    gctrace, which leads to races on reading various statistics to print
    them and the next GC cycle overwriting those statistics.
    
    Fix this by moving the release of worldsema after the gctrace print.
    
    Change-Id: I3d044ea0f77d80f3b4050af6b771e7912258662a
    Reviewed-on: https://go-review.googlesource.com/17812
    Run-TryBot: Austin Clements <austin@google.com>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    1e1ea669
Name
Last commit
Last update
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...