Skip to content

runtime: panic (slice bounds out of range) in runtime.gcInstallStackBarrier #11080

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

Closed
kostya-sh opened this issue Jun 5, 2015 · 3 comments
Closed
Milestone

Comments

@kostya-sh
Copy link
Contributor

This doesn't happen every time.

Using tip (bbc4351).

# crypto/x509
panic: runtime error: slice bounds out of range
fatal error: panic on system stack

runtime stack:
runtime.throw(0x854ad0, 0x15)
    /home/ksh/work/os-code/go/src/runtime/panic.go:527 +0x96
runtime.gopanic(0x7ce940, 0xc20800e150)
    /home/ksh/work/os-code/go/src/runtime/panic.go:354 +0xb9
runtime.panicslice()
    /home/ksh/work/os-code/go/src/runtime/panic.go:18 +0x49
runtime.gcInstallStackBarrier(0xc208000160, 0xc2084b1c78)
    /home/ksh/work/os-code/go/src/runtime/mgcmark.go:510 +0xae
runtime.scanstack.func1(0xc2084b1c78, 0x0, 0x1)
    /home/ksh/work/os-code/go/src/runtime/mgcmark.go:365 +0x9f
runtime.gentraceback(0x75d275, 0xc2080911b0, 0x0, 0xc208000160, 0x0, 0x0, 0x7fffffff, 0xc2084b1d90, 0x0, 0x0, ...)
    /home/ksh/work/os-code/go/src/runtime/traceback.go:336 +0xa7e
runtime.scanstack(0xc208000160)
    /home/ksh/work/os-code/go/src/runtime/mgcmark.go:380 +0x34e
runtime.gcphasework(0xc208000160)
    /home/ksh/work/os-code/go/src/runtime/mgcmark.go:273 +0x6d
runtime.stopg(0xc208000160, 0x3)
    /home/ksh/work/os-code/go/src/runtime/proc1.go:395 +0x8e
runtime.markroot(0xc208020000, 0x5)
    /home/ksh/work/os-code/go/src/runtime/mgcmark.go:138 +0x1ef
runtime.parfordo(0xc208020000)
    /home/ksh/work/os-code/go/src/runtime/parfor.go:95 +0x12a
runtime.gcscan_m()
    /home/ksh/work/os-code/go/src/runtime/mgcmark.go:37 +0xde
runtime.gc.func1()
    /home/ksh/work/os-code/go/src/runtime/mgc.go:843 +0x5c
runtime.systemstack(0xc208026000)
    /home/ksh/work/os-code/go/src/runtime/asm_amd64.s:262 +0x7c
runtime.mstart()
    /home/ksh/work/os-code/go/src/runtime/proc1.go:656

goroutine 5 [garbage collection scan]:
runtime.systemstack_switch()
    /home/ksh/work/os-code/go/src/runtime/asm_amd64.s:216 fp=0xc20802fce8 sp=0xc20802fce0
runtime.gc(0x0)
    /home/ksh/work/os-code/go/src/runtime/mgc.go:855 +0x1d9 fp=0xc20802ff90 sp=0xc20802fce8
runtime.backgroundgc()
    /home/ksh/work/os-code/go/src/runtime/mgc.go:775 +0x3d fp=0xc20802ffc0 sp=0xc20802ff90
runtime.goexit()
    /home/ksh/work/os-code/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc20802ffc8 sp=0xc20802ffc0
created by runtime.startGC
    /home/ksh/work/os-code/go/src/runtime/mgc.go:748 +0x147

goroutine 1 [syscall]:
syscall.Syscall(0x4, 0xc20849bef0, 0xc2085886c0, 0x0, 0xffffffffffffffff, 0x0, 0x2)
    /home/ksh/work/os-code/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.Stat(0xc20849be30, 0x25, 0xc2085886c0, 0x0, 0x0)
    /home/ksh/work/os-code/go/src/syscall/zsyscall_linux_amd64.go:1529 +0x8b
os.Stat(0xc20849be30, 0x25, 0x0, 0x0, 0x0, 0x0)
    /home/ksh/work/os-code/go/src/os/file_unix.go:154 +0x6a
cmd/internal/obj.Access(0xc20849be30, 0x25, 0x0, 0x2)
    /home/ksh/work/os-code/go/src/cmd/internal/obj/util.go:173 +0x8e
cmd/compile/internal/gc.findpkg(0xc20845a3f0, 0xc, 0xc20849be30, 0x25, 0xc9a300)
    /home/ksh/work/os-code/go/src/cmd/compile/internal/gc/lex.go:605 +0x8a9
cmd/compile/internal/gc.importfile(0xc208092a50, 0x26a)
    /home/ksh/work/os-code/go/src/cmd/compile/internal/gc/lex.go:711 +0xc2d
cmd/compile/internal/gc.(*yyParserImpl).Parse(0xc208032038, 0x7fbad15be728, 0xdc0e10, 0x0)
    go.y:292 +0x2008
cmd/compile/internal/gc.yyparse()
    /home/ksh/work/os-code/go/src/cmd/compile/internal/gc/lex.go:1822 +0xb4
cmd/compile/internal/gc.Main()
    /home/ksh/work/os-code/go/src/cmd/compile/internal/gc/lex.go:345 +0x1b35
cmd/compile/internal/amd64.Main()
    /home/ksh/work/os-code/go/src/cmd/compile/internal/amd64/galign.go:127 +0x58d
main.main()
    /home/ksh/work/os-code/go/src/cmd/compile/main.go:26 +0x189
ok      crypto/sha512   0.003s
ok      crypto/subtle   0.005s
ok      crypto/tls  1.769s
FAIL    crypto/x509 [build failed]
ok      database/sql    0.048s
ok      database/sql/driver 0.005s
ok      debug/dwarf 0.015s

Not sure if it is related but also getting the following test failure (consistently):

ok      cmd/fix 0.075s
--- FAIL: TestNoteReading-4 (11.84s)
    note_test.go:46: buildID in hello binary = "", want "TestNoteReading-Build-ID"
FAIL
FAIL    cmd/go  19.592s
@kostya-sh
Copy link
Contributor Author

One more failure, looks like memory corruption somewhere:

ok      mime/multipart  0.248s
--- FAIL: TestExhaustive-4 (0.88s)
    reader_test.go:202: Got:
        OK: 21576
        invalid bytes after =: 3397
        quotedprintable: invalid hex byte 0x0a: 1400
        quotedprintable: invalid hex byte 0x0d: 2700
        quotedprintable: invalid hex byte 0x20: 2490
        quotedprintable: invalid hex byte 0x3d: 384
        unexpected EOF: 3122
        �p�(�>=e������: 56
        Want:
        OK: 21576
        invalid bytes after =: 3397
        quotedprintable: invalid hex byte 0x0a: 1400
        quotedprintable: invalid hex byte 0x0d: 2700
        quotedprintable: invalid hex byte 0x20: 2490
        quotedprintable: invalid hex byte 0x3d: 440
        unexpected EOF: 3122
FAIL
FAIL    mime/quotedprintable    0.908s
ok      net 2.232s
ok      net/http    6.302s

@bradfitz bradfitz changed the title cmd/go: panic (slice bounds out of range) when running ./all.bash runtime: panic (slice bounds out of range) in runtime.gcInstallStackBarrier Jun 5, 2015
@bradfitz bradfitz added this to the Go1.5 milestone Jun 5, 2015
@bradfitz
Copy link
Contributor

bradfitz commented Jun 5, 2015

Let's ignore the buildID failure and only discuss the stack barrier panic in this bug.

I just got it too, also at bbc4351

crypto/elliptic
encoding/asn1
crypto/rand
go/parser
go/printer
crypto/rsa
mime/quotedprintable
crypto/ecdsa
cmd/addr2line
crypto/x509/pkix
net/http/internal
text/template/parse
go/constant
panic: runtime error: slice bounds out of range
fatal error: panic on system stack

runtime stack:
runtime.throw(0x78a7d0, 0x15)
        /home/bradfitz/go/src/runtime/panic.go:527 +0x96
runtime.gopanic(0x6e75a0, 0xc20800e0f0)
        /home/bradfitz/go/src/runtime/panic.go:354 +0xb9
runtime.panicslice()
        /home/bradfitz/go/src/runtime/panic.go:18 +0x49
runtime.gcInstallStackBarrier(0xc2082a6dc0, 0xc208535c78)
        /home/bradfitz/go/src/runtime/mgcmark.go:510 +0xae
runtime.scanstack.func1(0xc208535c78, 0x0, 0x1)
        /home/bradfitz/go/src/runtime/mgcmark.go:365 +0x9f
runtime.gentraceback(0x5c3225, 0xc2085a0a18, 0x0, 0xc2082a6dc0, 0x0, 0x0, 0x7fffffff, 0xc208535d90, 0x0, 0x0, ...)
        /home/bradfitz/go/src/runtime/traceback.go:336 +0xa7e
runtime.scanstack(0xc2082a6dc0)
        /home/bradfitz/go/src/runtime/mgcmark.go:380 +0x34e
runtime.gcphasework(0xc2082a6dc0)
        /home/bradfitz/go/src/runtime/mgcmark.go:273 +0x6d
runtime.stopg(0xc2082a6dc0, 0x3)
        /home/bradfitz/go/src/runtime/proc1.go:395 +0x8e
runtime.markroot(0xc208022000, 0x14)
        /home/bradfitz/go/src/runtime/mgcmark.go:138 +0x1ef
runtime.parfordo(0xc208022000)
        /home/bradfitz/go/src/runtime/parfor.go:95 +0x12a
runtime.gcscan_m()
        /home/bradfitz/go/src/runtime/mgcmark.go:37 +0xde
runtime.gc.func1()
        /home/bradfitz/go/src/runtime/mgc.go:843 +0x5c
runtime.systemstack(0xc20802aa00)
        /home/bradfitz/go/src/runtime/asm_amd64.s:262 +0x7c
runtime.mstart()
        /home/bradfitz/go/src/runtime/proc1.go:656

goroutine 17 [garbage collection scan]:
runtime.systemstack_switch()
        /home/bradfitz/go/src/runtime/asm_amd64.s:216 fp=0xc2080304e8 sp=0xc2080304e0
runtime.gc(0x0)
        /home/bradfitz/go/src/runtime/mgc.go:855 +0x1d9 fp=0xc208030790 sp=0xc2080304e8
runtime.backgroundgc()
        /home/bradfitz/go/src/runtime/mgc.go:775 +0x3d fp=0xc2080307c0 sp=0xc208030790
runtime.goexit()
        /home/bradfitz/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc2080307c8 sp=0xc2080307c0
created by runtime.startGC
        /home/bradfitz/go/src/runtime/mgc.go:748 +0x147

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc2084b0d80)
        /home/bradfitz/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc20831cb40)
        /home/bradfitz/go/src/sync/waitgroup.go:132 +0x15a
main.(*builder).do(0xc20812f180, 0xc2083c52b0)
        /home/bradfitz/go/src/cmd/go/build.go:1177 +0x3c6
main.runInstall(0x8e4560, 0xc20800a100, 0x2, 0x2)
        /home/bradfitz/go/src/cmd/go/build.go:542 +0x324
main.main()
        /home/bradfitz/go/src/cmd/go/main.go:177 +0x74d

goroutine 5 [syscall]:
os/signal.loop()
        /home/bradfitz/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
        /home/bradfitz/go/src/os/signal/signal_unix.go:28 +0x37
...     

@aclements
Copy link
Member

Duplicate of #11049.

@kostya-sh, please file two new bugs for the build-id failure and the memory corruption. Thanks!

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants