• Austin Clements's avatar
    runtime: one more Map{Bits,Spans} before arena_used update · 9a3112bc
    Austin Clements authored
    In order to avoid a race with a concurrent write barrier or garbage
    collector thread, any update to arena_used must be preceded by mapping
    the corresponding heap bitmap and spans array memory. Otherwise, the
    concurrent access may observe that a pointer falls within the heap
    arena, but then attempt to access unmapped memory to look up its span
    or heap bits.
    
    Commit d57c889a fixed all of the places where we updated arena_used
    immediately before mapping the heap bitmap and spans, but it missed
    the one place where we update arena_used and depend on later code to
    update it again and map the bitmap and spans. This creates a window
    where the original race can still happen. This commit fixes this by
    mapping the heap bitmap and spans before this arena_used update as
    well. This code path is only taken when expanding the heap reservation
    on 32-bit over a hole in the address space, so these extra mmap calls
    should have negligible impact.
    
    Fixes #10212, #11324.
    
    Change-Id: Id67795e6c7563eb551873bc401e5cc997aaa2bd8
    Reviewed-on: https://go-review.googlesource.com/11340
    Run-TryBot: Austin Clements <austin@google.com>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    Reviewed-by: 's avatarDmitry Vyukov <dvyukov@google.com>
    9a3112bc
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...