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

Closed
bradfitz opened this issue Jun 12, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@bradfitz
Copy link
Member

commented Jun 12, 2015

Seen at http://build.golang.org/log/9c020399c951339481c3f765bc35974c7dacf548 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]:
cmd/link/internal/ld.genasmsym(0x6d2cc0)
    /tmp/workdir/go/src/cmd/link/internal/ld/lib.go:1752 +0xe0e
cmd/link/internal/ld.Asmelfsym()
    /tmp/workdir/go/src/cmd/link/internal/ld/symtab.go:200 +0x71
cmd/link/internal/amd64.asmb()
    /tmp/workdir/go/src/cmd/link/internal/amd64/asm.go:735 +0x10ed
cmd/link/internal/ld.Ldmain()
    /tmp/workdir/go/src/cmd/link/internal/ld/pobj.go:245 +0x1ed1
cmd/link/internal/amd64.Main()
    /tmp/workdir/go/src/cmd/link/internal/amd64/obj.go:44 +0x19
main.main()
    /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

@bradfitz

This comment has been minimized.

Copy link
Member Author

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") {  
                        continue  
                }  

So s.Name is the empty string?

@bradfitz

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2015

@aclements, memory corruption in the GC?

@aclements

This comment has been minimized.

Copy link
Member

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?

@bradfitz

This comment has been minimized.

Copy link
Member Author

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.

@rsc

This comment has been minimized.

Copy link
Contributor

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.
You can’t perform that action at this time.