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
bufio crash on 386 #1650
Labels
Comments
People have been reporting occasional crashes on 386, perhaps due to a garbage collector bug. Maybe this will be the reproducible case we needed. Owner changed to @rsc. Status changed to Accepted. |
malloc/free - deadlock: linux/amd64 hg id a15522fba283 tip make -C gob testshort make[1]: Entering directory `/home/peter/open/src/pkg/gob' gotest -test.short -test.timeout=60 rm -f _test/gob.a 6g -o _gotest_.6 decode.go decoder.go doc.go encode.go encoder.go error.go type.go codec_test.go encoder_test.go gobencdec_test.go timing_test.go type_test.go rm -f _test/gob.a gopack grc _test/gob.a _gotest_.6 throw: malloc/free - deadlock [signal 0xb code=0x1 addr=0x5 pc=0x408ec9] runtime.throw+0x40 /home/peter/open/src/pkg/runtime/runtime.c:102 runtime.throw(0x5532c0, 0xf8400135b0) runtime.mallocgc+0x63 /home/peter/open/src/pkg/runtime/malloc.c:36 runtime.mallocgc(0x10, 0x100000000, 0x2b6200000001, 0x40b89f, 0x406b53, ...) runtime.mal+0x3f /home/peter/open/src/pkg/runtime/malloc.c:289 runtime.mal(0x10, 0x1) copyin+0x6f /home/peter/open/src/pkg/runtime/iface.c:160 copyin(0x47d930, 0x2b62b3c86650, 0x2b62b3c86668, 0x10000001f, 0x41370d, ...) runtime.convT2E+0x52 /home/peter/open/src/pkg/runtime/iface.c:209 runtime.convT2E(0x47d930, 0x552aff) runtime.newErrorString+0x38 /home/peter/open/src/pkg/runtime/error.go:107 runtime.newErrorString(0x552aff, 0x31, 0x2b62b3c866b0, 0x2b62b3c69cc0, 0x552aff, ...) runtime.panicstring+0x8b /home/peter/open/src/pkg/runtime/runtime.c:115 runtime.panicstring(0x552aff, 0x41359e) runtime.sigpanic+0x144 /home/peter/open/src/pkg/runtime/linux/thread.c:292 runtime.sigpanic() MCentral_Alloc+0x4b /home/peter/open/src/pkg/runtime/mcentral.c:81 MCentral_Alloc(0x2569028, 0x256a688) runtime.MCentral_AllocList+0xa3 /home/peter/open/src/pkg/runtime/mcentral.c:57 runtime.MCentral_AllocList(0x2569028, 0x2b6200000020, 0x2b62b3c86798, 0x413768, 0x256a678, ...) runtime.MCache_Alloc+0x74 /home/peter/open/src/pkg/runtime/mcache.c:23 runtime.MCache_Alloc(0x2b62b3c46000, 0x1, 0x8, 0x1, 0xf83ffed1f8, ...) runtime.mallocgc+0xe7 /home/peter/open/src/pkg/runtime/malloc.c:47 runtime.mallocgc(0x8, 0x100000001, 0x1, 0x1, 0x800, ...) makeslice1+0x7d /home/peter/open/src/pkg/runtime/slice.c:44 makeslice1(0x484c58, 0x500000005, 0x2b62b3c86898, 0xf8400227e0, 0x9000000005, ...) runtime.makeslice+0x86 /home/peter/open/src/pkg/runtime/slice.c:24 runtime.makeslice(0x484c58, 0x5, 0x5, 0x476d69, 0x500000005, ...) strconv.fmtF+0x7b /home/peter/open/src/pkg/strconv/ftoa.go:323 strconv.fmtF(0xf84012e000, 0xf84012e000, 0xf800000002, 0xf840000b28, 0x4, ...) strconv.genericFtoa+0x419 /home/peter/open/src/pkg/strconv/ftoa.go:135 strconv.genericFtoa(0x3f62d98bf7f06706, 0x2f7f06766, 0x554604, 0x2b62b3c869f0, 0x2b6200000004, ...) strconv.Ftoa64+0x54 /home/peter/open/src/pkg/strconv/ftoa.go:52 strconv.Ftoa64(0x3f62d98bf7f06706, 0x200000066, 0x2, 0x2b62b3c869f0, 0x45b9ec, ...) fmt.*fmt·fmt_f64+0x4a /home/peter/open/src/pkg/fmt/format.go:327 fmt.*fmt·fmt_f64(0xf840040210, 0x3f62d98bf7f06706, 0x80047d4d0, 0x2b6200000001) fmt.*pp·fmtFloat64+0xdf /home/peter/open/src/pkg/fmt/print.go:430 fmt.*pp·fmtFloat64(0xf8400401a0, 0x3f62d98bf7f06706, 0x3f62d98b00000066, 0x47d4d0, 0x3f62d98bf7f06706, ...) fmt.*pp·printField+0x527 /home/peter/open/src/pkg/fmt/print.go:609 fmt.*pp·printField(0xf8400401a0, 0x47d4d0, 0x3f62d98bf7f06706, 0x66, 0x0, ...) fmt.*pp·doPrintf+0x714 /home/peter/open/src/pkg/fmt/print.go:913 fmt.*pp·doPrintf(0xf8400401a0, 0x4d4ae8, 0x2b620000000e, 0xf840013fa0, 0x100000001, ...) fmt.Sprintf+0x5d /home/peter/open/src/pkg/fmt/print.go:179 fmt.Sprintf(0x4d4ae8, 0xe, 0xf840013fa0, 0x100000001, 0xf8400c4401, ...) testing.RunTests+0x34c /home/peter/open/src/pkg/testing/testing.go:192 testing.RunTests(0x400c00, 0xf84001bb00, 0x3800000038, 0x400db6) testing.Main+0x4f /home/peter/open/src/pkg/testing/testing.go:163 testing.Main(0x400c00, 0xf84001bb00, 0x3800000038, 0xf8400415d0, 0x200000002, ...) main.main+0x6d /home/peter/open/src/pkg/gob/_testmain.go:87 main.main() runtime.mainstart+0xf /home/peter/open/src/pkg/runtime/amd64/asm.s:77 runtime.mainstart() runtime.goexit /home/peter/open/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- _rt0_amd64+0x8e /home/peter/open/src/pkg/runtime/amd64/asm.s:64 goroutine 18 [4]: runtime.gosched+0x6f /home/peter/open/src/pkg/runtime/proc.c:600 runtime.gosched() runfinq+0x50 /home/peter/open/src/pkg/runtime/mgc0.c:639 runfinq() runtime.goexit /home/peter/open/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- runtime.gc /home/peter/open/src/pkg/runtime/mgc0.c:515 goroutine 2 [3]: runtime.entersyscall+0x1a /home/peter/open/src/pkg/runtime/proc.c:620 runtime.entersyscall() syscall.Syscall6+0x5 /home/peter/open/src/pkg/syscall/asm_linux_amd64.s:40 syscall.Syscall6() syscall.Select+0x69 /home/peter/open/src/pkg/syscall/zsyscall_linux_amd64.go:920 syscall.Select(0x0, 0x0, 0x0, 0x0, 0xf840013430, ...) syscall.Sleep+0x7a /home/peter/open/src/pkg/syscall/syscall_linux.go:189 syscall.Sleep(0x3b9aca00, 0xffffffff, 0x0, 0x0) time.sysSleep+0x25 /home/peter/open/src/pkg/time/sys.go:57 time.sysSleep(0x3b9aca00, 0x3c0000000f, 0xf840002400, 0x204000fc30) time.sleeper+0xa9 /home/peter/open/src/pkg/time/sleep.go:128 time.sleeper(0x1, 0x0) runtime.goexit /home/peter/open/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- time.after+0x1de /home/peter/open/src/pkg/time/sleep.go:109 gotest: "./6.out -test.short=true -test.timeout=60" failed: exit status 2 make[1]: *** [testshort] Error 2 make[1]: Leaving directory `/home/peter/open/src/pkg/gob' make: *** [gob.testshort] Error 2 |
Failing in the same test with a different error. runtime error: invalid memory address or nil pointer dereference: linux/am64 hg id 82050f8e7881 tip make -C gob testshort make[1]: Entering directory `/home/peter/append/src/pkg/gob' gotest -test.short -test.timeout=60 rm -f _test/gob.a 6g -o _gotest_.6 decode.go decoder.go doc.go encode.go encoder.go error.go type.go codec_test.go encoder_test.go gobencdec_test.go timing_test.go type_test.go rm -f _test/gob.a gopack grc _test/gob.a _gotest_.6 panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x5 pc=0x437714] runtime.panic+0xac /home/peter/append/src/pkg/runtime/proc.c:1034 runtime.panic(0x47d930, 0xf840013f40) runtime.panicstring+0xa3 /home/peter/append/src/pkg/runtime/runtime.c:116 runtime.panicstring(0x552aff, 0xf84001f8c0) runtime.sigpanic+0x144 /home/peter/append/src/pkg/runtime/linux/thread.c:292 runtime.sigpanic() gob.TestGobEncoderIndirectField+0x38a /home/peter/append/src/pkg/gob/gobencdec_test.go:214 gob.TestGobEncoderIndirectField(0xf8401338c0, 0xf840133840) testing.tRunner+0x2b /home/peter/append/src/pkg/testing/testing.go:152 testing.tRunner(0xf8401338c0, 0xf84001bec0, 0x0, 0x0) runtime.goexit /home/peter/append/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- testing.RunTests+0x277 /home/peter/append/src/pkg/testing/testing.go:189 goroutine 18 [4]: runtime.gosched+0x6f /home/peter/append/src/pkg/runtime/proc.c:600 runtime.gosched() runfinq+0x50 /home/peter/append/src/pkg/runtime/mgc0.c:639 runfinq() runtime.goexit /home/peter/append/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- runtime.gc /home/peter/append/src/pkg/runtime/mgc0.c:515 goroutine 2 [3]: runtime.entersyscall+0x1a /home/peter/append/src/pkg/runtime/proc.c:620 runtime.entersyscall() syscall.Syscall6+0x5 /home/peter/append/src/pkg/syscall/asm_linux_amd64.s:40 syscall.Syscall6() syscall.Select+0x69 /home/peter/append/src/pkg/syscall/zsyscall_linux_amd64.go:920 syscall.Select(0x0, 0x0, 0x0, 0x0, 0xf840013430, ...) syscall.Sleep+0x7a /home/peter/append/src/pkg/syscall/syscall_linux.go:189 syscall.Sleep(0x3b9aca00, 0xffffffff, 0x0, 0x0) time.sysSleep+0x25 /home/peter/append/src/pkg/time/sys.go:57 time.sysSleep(0x3b9aca00, 0x3c0000000f, 0xf840002400, 0x204000fc30) time.sleeper+0xa9 /home/peter/append/src/pkg/time/sleep.go:128 time.sleeper(0x1, 0x0) runtime.goexit /home/peter/append/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- time.after+0x1de /home/peter/append/src/pkg/time/sleep.go:109 goroutine 1 [4]: runtime.gosched+0x6f /home/peter/append/src/pkg/runtime/proc.c:600 runtime.gosched() runtime.chanrecv+0x403 /home/peter/append/src/pkg/runtime/chan.c:345 runtime.chanrecv(0xf840116120, 0x2b41ad881ed0, 0x0, 0x0, 0x402619, ...) runtime.chanrecv1+0x4a /home/peter/append/src/pkg/runtime/chan.c:439 runtime.chanrecv1(0xf840116120, 0xf84001bec0) testing.RunTests+0x28b /home/peter/append/src/pkg/testing/testing.go:190 testing.RunTests(0x400c00, 0xf84001bb00, 0x3800000038, 0x400db6) testing.Main+0x4f /home/peter/append/src/pkg/testing/testing.go:163 testing.Main(0x400c00, 0xf84001bb00, 0x3800000038, 0xf8400415d0, 0x200000002, ...) main.main+0x6d /home/peter/append/src/pkg/gob/_testmain.go:87 main.main() runtime.mainstart+0xf /home/peter/append/src/pkg/runtime/amd64/asm.s:77 runtime.mainstart() runtime.goexit /home/peter/append/src/pkg/runtime/proc.c:178 runtime.goexit() ----- goroutine created by ----- _rt0_amd64+0x8e /home/peter/append/src/pkg/runtime/amd64/asm.s:64 gotest: "./6.out -test.short=true -test.timeout=60" failed: exit status 2 make[1]: *** [testshort] Error 2 make[1]: Leaving directory `/home/peter/append/src/pkg/gob' make: *** [gob.testshort] Error 2 |
I ran in to this bug (I think). This post is to state how I reproduce it. Which compiler are you using (5g, 6g, 8g, gccgo)? 8g Which operating system are you using? Debian Squeeze GNU/Linux 32bit. Which revision are you using? SHA: 872404d61597 , Revision: 8040 How to reproduce. 1. Start godoc: godoc -http=":6060" 2. Go to pkg/reflect (it needs to be on a package page). 3. Hold down F5 for 3 seconds (or whatever key you use to refresh page rapidly). After these steps the godoc process takes up 100% CPU and starts to increase in memory usage by 1mB every few seconds. |
I can usually crash it without the visiting any godoc webpage. Run 'godoc -http=:6060' and wait for it to build its index (or whatever it does consuming a lot of memory). If it crashes, you'll get a stack trace as above. If it doesn't crash, you'll get something like: 2011/04/10 14:24:12 before GC: bytes = 466709472 footprint = 564632700 2011/04/10 14:24:13 after GC: bytes = 301146728 footprint = 564632700 |
Another report of problems with gotest for gob. gob test is broken - golang-dev http://groups.google.com/group/golang-dev/browse_thread/thread/74992861e511f8ee |
Hi fshahriar, I have a suspicion that the original reports of godoc crashing have been fixed by http://code.google.com/p/go/source/detail?r=0637076c39bc00d38c5ef0d846e113520a7e5d2e on the April 13th. Are you able to reproduce the crash now ? Cheers Dave |
Nope, that didn't fix it. I just tried hg tip (8135:e3c23620297a) and I can still reproduce the crash. New stack trace attached. Attachments:
|
I think this is caused by complete exhaustion of the heap, runtime.panicstring+0x81 /export/home/dave/go/src/pkg/runtime/runtime.c:115 runtime.panicstring(0x83159ef, 0x9b4a8d80) runtime.sigpanic+0x11b /export/home/dave/go/src/pkg/runtime/linux/thread.c:292 runtime.sigpanic() runtime.MCache_Alloc+0x96 /export/home/dave/go/src/pkg/runtime/mcache.c:29 runtime.MCache_Alloc(0x87739db0, 0x1d, 0x400, 0x1, 0x810e06b, ...) The MCache is empty so it calls // Replenish using central lists. n = runtime·MCentral_AllocList(&runtime·mheap.central[sizeclass], runtime·class_to_transfercount[sizeclass], &first); l->list = first; l->first is then referenced on line 29, v = l->list; Which causes the SIGBUS panic, which is then made worse by the runtime trying to allocate a bit more memory for the panic string if(g->sigcode0 == BUS_ADRERR && g->sigcode1 < 0x1000) runtime·panicstring("invalid memory address or nil pointer dereference"); |
The attached program crashes reliably after a few seconds. throw: malloc/free - deadlock [signal 0xb code=0x1 addr=0x0 pc=0x804eef8] runtime.throw+0x43 /home/sven/go/src/pkg/runtime/runtime.c:102 runtime.throw(0x80f1da8, 0x80f2ee0) runtime.mallocgc+0x67 /home/sven/go/src/pkg/runtime/malloc.c:36 runtime.mallocgc(0x8, 0x0, 0x1, 0x1, 0x1, ...) runtime.mal+0x43 /home/sven/go/src/pkg/runtime/malloc.c:289 runtime.mal(0x8, 0x8058c86) copyin+0x64 /home/sven/go/src/pkg/runtime/iface.c:160 copyin(0x80988e4, 0x87788c70, 0x87788c7c, 0x80fc7f8) ... Attachments:
|
This issue was closed by revision e2f9c73. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: