-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.RaceDetectorcompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted
Milestone
Description
What did you do?
// plugin/plugin.go
package main
import (
"os"
"time"
)
var counter int
func main() {
os.Exit(Main())
}
func Main() int {
go func() {
counter++
}()
time.Sleep(500 * time.Millisecond)
return counter
}
// plugin-runner.go
package main
import (
"os"
"plugin"
)
func main() {
p, err := plugin.Open(os.Args[1])
if err != nil {
panic(err)
}
sym, err := p.Lookup("Main")
if err != nil {
panic(err)
}
f := sym.(func() int)
_ = f()
}
$ go build -o plugin/plugin.so -race -buildmode=plugin plugin/plugin.go
$ go run -race plugin-runner.go plugin/plugin.so
What did you expect to see?
A DATA RACE
output similar to this one:
$ go run -race plugin/plugin.go
==================
WARNING: DATA RACE
Read at 0x00000051da38 by main goroutine:
main.Main()
/go/src/github.com/tiborvass/goissues/plugin/race-nodetect/plugin/plugin.go:19 +0x5f
main.main()
/go/src/github.com/tiborvass/goissues/plugin/race-nodetect/plugin/plugin.go:11 +0x2f
Previous write at 0x00000051da38 by goroutine 6:
main.Main.func1()
/go/src/github.com/tiborvass/goissues/plugin/race-nodetect/plugin/plugin.go:16 +0x56
Goroutine 6 (finished) created at:
main.Main()
/go/src/github.com/tiborvass/goissues/plugin/race-nodetect/plugin/plugin.go:15 +0x42
main.main()
/go/src/github.com/tiborvass/goissues/plugin/race-nodetect/plugin/plugin.go:11 +0x2f
==================
exit status 1
What did you see instead?
No output. I reproduced it 100% on both linux and darwin.
System details
go version go1.10 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build269754766=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.10 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.10
uname -sr: Linux 4.9.75-linuxkit-aufs
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.24-11+deb9u1) stable release version 2.24, by Roland McGrath et al.
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.RaceDetectorcompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted