-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: crashes when -buildmode=shared is set and modules enabled #42189
Comments
Update: |
The attached @shawn-xdji, can you confirm the version of the |
Obsoleted by #47788 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Two crashes could be produced when running -buildmode=shared with 'go module' being enabled, depending on the package name, here are details with a reduced test-case:
step 1: create hello.go (outside $GOPATH and $GOROOT)
step 2: create a go.mod, picking up a module name without hostname
$ go mod init mymodule
step 3:
$ go install -buildmode=shared std
$ go install -buildmode=shared -linkshared mymodule
step 4:
If changing the package name in hello.go to anything else other than 'main' the compiler crashes with a different stack.
step 5:
turns out the module name is the direct reason, if changing it to something like example.com/mymodule then the compiler simply errors out:
What did you expect to see?
no crash, and meaningful error message
What did you see instead?
various crashes.
The text was updated successfully, but these errors were encountered: