• Keith Randall's avatar
    runtime: fix darwin 386/amd64 stack switches · e86c2678
    Keith Randall authored
    A few libc_ calls were missing stack switches.
    
    Unfortunately, adding the stack switches revealed a deeper problem.
    systemstack() is fundamentally flawed because when you do
    
        systemstack(func() { ... })
    
    There's no way to mark the anonymous function as nosplit.  At first I
    thought it didn't matter, as that function runs on the g0 stack.  But
    nosplit is still required, because some syscalls are done when stack
    bounds are not set up correctly (e.g. in a signal handler, which runs
    on the g0 stack, but g is still pointing at the g stack).  Instead use
    asmcgocall and funcPC, so we can be nosplit all the way down.
    
    Mid-stack inlining now pushes darwin over the nosplit limit also.
    Leaving that as a TODO.
    Update #23168
    
    This might fix the cause of occasional darwin hangs.
    Update #25181
    
    Update #17490
    
    Change-Id: If9c3ef052822c7679f5a1dd192443f714483327e
    Reviewed-on: https://go-review.googlesource.com/111258Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    e86c2678
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...