Skip to content

runtime: msanwrite segfaults when called without a g on arm64 #34338

@zhangfannie

Description

@zhangfannie

What version of Go are you using (go version)?

$ go version
go version devel +c3c53661ba Tue Sep 17 04:37:46 2019 +0000 linux/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/home/fanzha02/.cache/go-build"
GOENV="/home/fanzha02/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/fanzha02/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/fanzha02/work/go_project/gomain"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/fanzha02/work/go_project/gomain/pkg/tool/linux_arm64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/fanzha02/work/go_project/gomain/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build714027259=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run testsanitizers/TestShared test

cd $GOROOT/src
run the command: CC=clang ../bin/go tool dist test -run testsanitizers
clang version: clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

What did you expect to see?

pass

What did you see instead?

The test failed.

../misc/cgo/testsanitizers

--- FAIL: TestShared (0.24s)
--- FAIL: TestShared/msan_shared (4.69s)
cshared_test.go:71: /tmp/TestShared066999108/msan_shared exited with exit status 77
MemorySanitizer:DEADLYSIGNAL
==24668==ERROR: MemorySanitizer: SEGV on unknown address 0x000000000030 (pc 0xffff94b3e9d4 bp 0xffffef3ca388 sp 0xffffef3ca390 T24668)
==24668==The signal is caused by a READ memory access.
==24668==Hint: address points to the zero page.
#0 0xffff94b3e9d3 (/tmp/TestShared066999108/libmsan_shared.so+0x8e9d3)

        MemorySanitizer can not provide additional info.
        SUMMARY: MemorySanitizer: SEGV (/tmp/TestShared066999108/libmsan_shared.so+0x8e9d3)
        ==24668==ABORTING

FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions