summaryrefslogtreecommitdiff
path: root/src/run.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-11-19 15:25:33 -0500
committerRuss Cox <rsc@golang.org>2014-11-19 15:25:33 -0500
commit5a7b7dd1f7f29f8dc53cdcde5a38c92165821838 (patch)
treeb7505b86b4e02b9e8ddc88abafa6095377f168be /src/run.bash
parent880ebd0ce5e22be226cb6a3a6afd4cdc421f636c (diff)
downloadgo-5a7b7dd1f7f29f8dc53cdcde5a38c92165821838.tar.gz
runtime: remove assumption that noptrdata data bss noptrbss are ordered and contiguous
The assumption can be violated by external linkers reordering them or inserting non-Go sections in between them. I looked briefly at trying to write out the _go_.o in external linking mode in a way that forced the ordering, but no matter what there's no way to force Go's data and Go's bss to be next to each other. If there is any data or bss from non-Go objects, it's very likely to get stuck in between them. Instead, rewrite the two places we know about that make the assumption. I grepped for noptrdata to look for more and didn't find any. The added race test (os/exec in external linking mode) fails without the changes in the runtime. It crashes with an invalid pointer dereference. Fixes issue 9133. LGTM=dneil R=dneil CC=dvyukov, golang-codereviews, iant https://codereview.appspot.com/179980043
Diffstat (limited to 'src/run.bash')
-rwxr-xr-xsrc/run.bash5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/run.bash b/src/run.bash
index 3c9430c87..9a0e1cb0f 100755
--- a/src/run.bash
+++ b/src/run.bash
@@ -70,9 +70,10 @@ case "$GOHOSTOS-$GOOS-$GOARCH-$CGO_ENABLED" in
linux-linux-amd64-1 | freebsd-freebsd-amd64-1 | darwin-darwin-amd64-1)
echo
echo '# Testing race detector.'
- go test -race -i runtime/race flag
+ go test -race -i runtime/race flag os/exec
go test -race -run=Output runtime/race
- go test -race -short flag
+ go test -race -short flag os/exec
+ go test -race -short -ldflags=-linkmode=external flag os/exec
esac
xcd() {