• Nikhil Benesch's avatar
    runtime: never call into race detector with retaken P · e496e612
    Nikhil Benesch authored
    cgocall could previously invoke the race detector on an M whose P had
    been retaken. The race detector would attempt to use the P-local state
    from this stale P, racing with the thread that was actually wired to
    that P. The result was memory corruption of ThreadSanitizer's internal
    data structures that presented as hard-to-understand assertion failures
    and segfaults.
    
    Reorder cgocall so that it always acquires a P before invoking the race
    detector, and add a test that stresses the interaction between cgo and
    the race detector to protect against future bugs of this kind.
    
    Fixes #27660.
    
    Change-Id: Ide93f96a23490314d6647547140e0a412a97f0d4
    Reviewed-on: https://go-review.googlesource.com/c/148717
    Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
    Reviewed-by: 's avatarDmitry Vyukov <dvyukov@google.com>
    e496e612
Name
Last commit
Last update
..
errors Loading commit data...
fortran Loading commit data...
gmp Loading commit data...
life Loading commit data...
nocgo Loading commit data...
stdio Loading commit data...
test Loading commit data...
testasan Loading commit data...
testcarchive Loading commit data...
testcshared Loading commit data...
testgodefs Loading commit data...
testplugin Loading commit data...
testsanitizers Loading commit data...
testshared Loading commit data...
testsigfwd Loading commit data...
testso Loading commit data...
testsovar Loading commit data...
testtls Loading commit data...