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: runtime error: index out of range #11186

bradfitz opened this issue Jun 12, 2015 · 5 comments

cmd/link: runtime error: index out of range #11186

bradfitz opened this issue Jun 12, 2015 · 5 comments


Copy link

@bradfitz bradfitz commented Jun 12, 2015

Seen at for openbsd-amd64-gce56 at 0d0ce8a

The linker crashed?

##### Testing packages.
ok      archive/tar 0.035s
ok      archive/zip 0.976s
ok      bufio   0.183s
ok      bytes   0.154s
ok      compress/bzip2  0.088s
ok      compress/flate  1.234s
ok      compress/gzip   0.014s
ok      compress/lzw    0.105s
ok      compress/zlib   2.157s
ok      container/heap  0.008s
ok      container/list  0.008s
ok      container/ring  0.020s
ok      crypto/aes  0.046s
ok      crypto/cipher   0.010s
ok      crypto/des  0.043s
ok      crypto/dsa  0.010s
ok      crypto/ecdsa    0.052s
ok      crypto/elliptic 0.084s
ok      crypto/hmac 0.009s
ok      crypto/md5  0.010s
ok      crypto/rand 0.045s
ok      crypto/rc4  0.172s
# testmain
panic: runtime error: index out of range

goroutine 1 [running]:
    /tmp/workdir/go/src/cmd/link/internal/ld/lib.go:1752 +0xe0e
    /tmp/workdir/go/src/cmd/link/internal/ld/symtab.go:200 +0x71
    /tmp/workdir/go/src/cmd/link/internal/amd64/asm.go:735 +0x10ed
    /tmp/workdir/go/src/cmd/link/internal/ld/pobj.go:245 +0x1ed1
    /tmp/workdir/go/src/cmd/link/internal/amd64/obj.go:44 +0x19
    /tmp/workdir/go/src/cmd/link/main.go:26 +0x189
ok      crypto/rsa  0.229s
FAIL    crypto/sha1 [build failed]
ok      crypto/sha256   0.009s
ok      crypto/sha512   0.041s
ok      crypto/subtle   0.019s
ok      crypto/tls  2.075s
ok      crypto/x509 2.003s
ok      database/sql    0.342s
ok      database/sql/driver 0.058s
ok      debug/dwarf 0.027s
ok      debug/elf   0.025s
ok      debug/gosym 0.376s
2015/06/12 06:27:45 Failed: exit status 2

/cc @rsc

@bradfitz bradfitz added this to the Go1.5Maybe milestone Jun 12, 2015
Copy link
Contributor Author

@bradfitz bradfitz commented Jun 12, 2015

Line 1752 is the second line here:

        for s := Ctxt.Allsym; s != nil; s = s.Allsym {  
                if s.Hide != 0 || (s.Name[0] == '.' && s.Version == 0 && s.Name != ".rathole") {  

So s.Name is the empty string?

Copy link
Contributor Author

@bradfitz bradfitz commented Jun 12, 2015

@aclements, memory corruption in the GC?

Copy link

@aclements aclements commented Jun 12, 2015

@bradfitz, not impossible, but that's also an easy conclusion to jump to. :) Unfortunately, it looks like this is the only time this has happened, so there's not much data to go by. Are there any goroutines or potential sources of non-determinism in the linker itself?

Copy link
Contributor Author

@bradfitz bradfitz commented Jun 12, 2015

The compiler and linker are both still single-threaded programs as far as I know, and I've never seen this before (and it was a random occurrence in the middle of other unrelated commits where the build passed), which makes me suspect memory corruption.

Copy link

@rsc rsc commented Jun 29, 2015

Going to close unless we can reproduce. We have plenty of memory corruption bugs, many of them fixed.

@rsc rsc closed this Jun 29, 2015
@golang golang locked and limited conversation to collaborators Jun 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants