Navigation Menu

Skip to content
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/link: segmentation fault when compiling plugin #17139

Closed
nussjustin opened this issue Sep 17, 2016 · 2 comments
Closed

cmd/link: segmentation fault when compiling plugin #17139

nussjustin opened this issue Sep 17, 2016 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@nussjustin
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

What did you do?

Tried to compile the following:

package main

// // Nothing to do
import "C"

func init() {
}

func main() {

}

Command: go build -buildmode=plugin plugin.go

What did you expect to see?

No errors.

What did you see instead?

# command-line-arguments
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xd8 pc=0x47abaa]

goroutine 1 [running]:
panic(0x5a2480, 0x68f4c0)
    /opt/go/src/runtime/panic.go:496 +0x1a0
cmd/link/internal/ld.(*deadcodepass).init(0xc420043ce8)
    /opt/go/src/cmd/link/internal/ld/deadcode.go:253 +0x6ba
cmd/link/internal/ld.deadcode(0xc4204c0000)
    /opt/go/src/cmd/link/internal/ld/deadcode.go:59 +0xca
cmd/link/internal/ld.Main()
    /opt/go/src/cmd/link/internal/ld/main.go:185 +0x802
main.main()
    /opt/go/src/cmd/link/main.go:55 +0x142

System details

go version devel +2e2db7a Sat Sep 17 02:54:11 2016 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/justinn/Workspace/go"
GORACE=""
GOROOT="/opt/go"
GOTOOLDIR="/opt/go/pkg/tool/linux_amd64"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build787786251=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
uname -sr: Linux 4.7.2-1-ARCH
/usr/lib/libc.so.6: GNU C Library (GNU libc) stable release version 2.24, by Roland McGrath et al.
gdb --version: GNU gdb (GDB) 7.11.1
@crawshaw crawshaw self-assigned this Sep 17, 2016
@crawshaw crawshaw added this to the Go1.8 milestone Sep 17, 2016
@quentinmit quentinmit added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 7, 2016
@rogpeppe
Copy link
Contributor

rogpeppe commented Oct 13, 2016

This seems to be the case when there are no exported symbols.
I get the same panic when compiling the program

package main

@crawshaw
Copy link
Member

crawshaw commented Nov 3, 2016

Fixed by 8eb9fda.

@crawshaw crawshaw closed this as completed Nov 3, 2016
@golang golang locked and limited conversation to collaborators Nov 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants