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

bufio crash on 386 #1650

Closed
fhs opened this issue Mar 29, 2011 · 15 comments
Closed

bufio crash on 386 #1650

fhs opened this issue Mar 29, 2011 · 15 comments

Comments

@fhs
Copy link
Contributor

fhs commented Mar 29, 2011

godoc crashes with the stack trace below. I was able to reproduce it after few restarts.

$ godoc -http=:6060
throw: malloc/free - deadlock

[signal 0xb code=0x1 addr=0x0 pc=0x8065b3e]

runtime.throw+0x43 /home/fhs/go/src/pkg/runtime/runtime.c:102
    runtime.throw(0x8305fb0, 0x0)
runtime.mallocgc+0x67 /home/fhs/go/src/pkg/runtime/malloc.c:36
    runtime.mallocgc(0x8, 0x0, 0x1, 0x1, 0x1, ...)
runtime.mal+0x43 /home/fhs/go/src/pkg/runtime/malloc.c:289
    runtime.mal(0x8, 0x8070175)
copyin+0x64 /home/fhs/go/src/pkg/runtime/iface.c:160
    copyin(0x816907c, 0x8776b780, 0x8776b78c, 0x8315d68)
runtime.convT2E+0x46 /home/fhs/go/src/pkg/runtime/iface.c:209
    runtime.convT2E(0x816907c, 0x83059ef)
runtime.newErrorString+0x34 /home/fhs/go/src/pkg/runtime/error.go:107
    runtime.newErrorString(0x83059ef, 0x31, 0x8776b7c0, 0x8718670)
runtime.panicstring+0x81 /home/fhs/go/src/pkg/runtime/runtime.c:115
    runtime.panicstring(0x83059ef, 0xb7777ff0)
runtime.sigpanic+0x11b /home/fhs/go/src/pkg/runtime/linux/thread.c:292
    runtime.sigpanic()
runtime.MCache_Alloc+0x96 /home/fhs/go/src/pkg/runtime/mcache.c:29
    runtime.MCache_Alloc(0x877a82f8, 0x2, 0x10, 0x1, 0x8776b890, ...)
runtime.mallocgc+0xe1 /home/fhs/go/src/pkg/runtime/malloc.c:47
    runtime.mallocgc(0x10, 0x1, 0x1, 0x1, 0x1, ...)
makeslice1+0x71 /home/fhs/go/src/pkg/runtime/slice.c:44
    makeslice1(0x816fcf8, 0x0, 0x4, 0x8776b890, 0xe56902, ...)
runtime.makeslice+0x95 /home/fhs/go/src/pkg/runtime/slice.c:24
    runtime.makeslice(0x816fcf8, 0x0, 0x0, 0x4, 0x0, ...)
index/suffixarray.*suffixSortable·updateGroups+0x53
/home/fhs/go/src/pkg/index/suffixarray/qsufsort.go:149
    index/suffixarray.*suffixSortable·updateGroups(0x9d5821a0, 0x13324e, 0x9d5821a0)
index/suffixarray.qsufsort+0x285 /home/fhs/go/src/pkg/index/suffixarray/qsufsort.go:58
    index/suffixarray.qsufsort(0x9c28b000, 0xf4bf3e, 0x11ffe00, 0x0, 0x806dd95, ...)
index/suffixarray.New+0x49 /home/fhs/go/src/pkg/index/suffixarray/suffixarray.go:36
    index/suffixarray.New(0x9c28b000, 0xf4bf3e, 0x11ffe00, 0x11ffe00, 0x0, ...)
main.NewIndex+0x5b7 /home/fhs/go/src/cmd/godoc/index.go:863
    main.NewIndex(0x97d6e000, 0x120fa001, 0x0, 0x0)
main.indexer+0xcf /home/fhs/go/src/cmd/godoc/godoc.go:1268
    main.indexer()
runtime.goexit /home/fhs/go/src/pkg/runtime/proc.c:178
    runtime.goexit()
----- goroutine created by -----
main.main+0x608 /home/fhs/go/src/cmd/godoc/main.go:287

goroutine 191 [4]:
runtime.gosched+0x6d /home/fhs/go/src/pkg/runtime/proc.c:600
    runtime.gosched()
runfinq+0x4e /home/fhs/go/src/pkg/runtime/mgc0.c:639
    runfinq()
runtime.goexit /home/fhs/go/src/pkg/runtime/proc.c:178
    runtime.goexit()
----- goroutine created by -----
runtime.gc /home/fhs/go/src/pkg/runtime/mgc0.c:515

goroutine 5 [3]:
runtime.entersyscall+0x18 /home/fhs/go/src/pkg/runtime/proc.c:620
    runtime.entersyscall()
syscall.Syscall6+0x5 /home/fhs/go/src/pkg/syscall/asm_linux_386.s:39
    syscall.Syscall6()
syscall.EpollWait+0x74 /home/fhs/go/src/pkg/syscall/zsyscall_linux_386.go:200
    syscall.EpollWait(0x7, 0x977fbf08, 0xa, 0xa, 0xffffffff, ...)
net.*pollster·WaitFD+0x147 /home/fhs/go/src/pkg/net/fd_linux.go:130
    net.*pollster·WaitFD(0x977fbf00, 0x97815660, 0x0, 0x0, 0x0, ...)
net.*pollServer·Run+0x10a /home/fhs/go/src/pkg/net/fd.go:226
    net.*pollServer·Run(0x97815660, 0x0)
runtime.goexit /home/fhs/go/src/pkg/runtime/proc.c:178
    runtime.goexit()
----- goroutine created by -----
net.newPollServer+0x344 /home/fhs/go/src/pkg/net/newpollserver.go:39

goroutine 1 [4]:
runtime.gosched+0x6d /home/fhs/go/src/pkg/runtime/proc.c:600
    runtime.gosched()
runtime.chanrecv+0x153 /home/fhs/go/src/pkg/runtime/chan.c:377
    runtime.chanrecv(0x97866ec0, 0x87768620, 0x0, 0x0, 0x8308b64, ...)
runtime.chanrecv1+0x3f /home/fhs/go/src/pkg/runtime/chan.c:439
    runtime.chanrecv1(0x97866ec0, 0x9789d000)
net.*pollServer·WaitRead+0x4a /home/fhs/go/src/pkg/net/fd.go:255
    net.*pollServer·WaitRead(0x97815660, 0x9789d000, 0x0)
net.*netFD·accept+0x2fe /home/fhs/go/src/pkg/net/fd.go:586
    net.*netFD·accept(0x9789d000, 0x8118f09, 0x0, 0x0, 0x0, ...)
net.*TCPListener·AcceptTCP+0x56 /home/fhs/go/src/pkg/net/tcpsock.go:261
    net.*TCPListener·AcceptTCP(0x97811268, 0x8065078, 0x0, 0x0)
net.*TCPListener·Accept+0x39 /home/fhs/go/src/pkg/net/tcpsock.go:271
    net.*TCPListener·Accept(0x97811268, 0x0, 0x0, 0x0, 0x0, ...)
http.*Server·Serve+0xb5 /home/fhs/go/src/pkg/http/server.go:761
    http.*Server·Serve(0x97870220, 0x978900a0, 0x97811268, 0x0, 0x0, ...)
http.*Server·ListenAndServe+0xb5 /home/fhs/go/src/pkg/http/server.go:748
    http.*Server·ListenAndServe(0x97870220, 0x97870220, 0x0)
http.ListenAndServe+0x55 /home/fhs/go/src/pkg/http/server.go:809
    http.ListenAndServe(0xbfce390f, 0x5, 0x97820d80, 0x977c82e0, 0x977c82e0, ...)
main.main+0x629 /home/fhs/go/src/cmd/godoc/main.go:290
    main.main()
runtime.mainstart+0xf /home/fhs/go/src/pkg/runtime/386/asm.s:93
    runtime.mainstart()
runtime.goexit /home/fhs/go/src/pkg/runtime/proc.c:178
    runtime.goexit()
----- goroutine created by -----
_rt0_386+0xc1 /home/fhs/go/src/pkg/runtime/386/asm.s:80
$


Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

Linux

Which revision are you using?  (hg identify)

b84e614e2516+ weekly/weekly.2011-03-28
@rsc
Copy link
Contributor

rsc commented Mar 30, 2011

Comment 1:

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.

@peterGo
Copy link
Contributor

peterGo commented Apr 2, 2011

Comment 2:

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

@peterGo
Copy link
Contributor

peterGo commented Apr 2, 2011

Comment 3:

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

@gopherbot
Copy link

Comment 4 by seth.bunce:

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.

@fhs
Copy link
Contributor Author

fhs commented Apr 10, 2011

Comment 5:

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

@peterGo
Copy link
Contributor

peterGo commented Apr 14, 2011

Comment 6:

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

@davecheney
Copy link
Contributor

Comment 7:

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

@fhs
Copy link
Contributor Author

fhs commented Apr 18, 2011

Comment 8:

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:

  1. cgo-stk.txt (4914 bytes)

@davecheney
Copy link
Contributor

Comment 9:

I just got the same thing. Running a heavy ab remotely (from AU to US) is ok, memory
usage stablised at ~460mb, but running the same ab on the host itself overloads godoc
and it eventually crashes.

@davecheney
Copy link
Contributor

Comment 10:

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");

@davecheney
Copy link
Contributor

@gopherbot
Copy link

Comment 12 by fibercut:

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:

  1. mem.go (704 bytes)

@rsc
Copy link
Contributor

rsc commented Apr 25, 2011

Comment 14:

Possible compiler bug.
Reproduced using program from #12 (thanks!) with GOGC=off.

@rsc
Copy link
Contributor

rsc commented Apr 26, 2011

Comment 15:

Looks like it is out of memory.  (Dave Cheney wins.)
4446062

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Apr 26, 2011

Comment 16:

This issue was closed by revision e2f9c73.

Status changed to Fixed.

@fhs fhs added fixed labels Apr 26, 2011
@fhs fhs assigned rsc Apr 26, 2011
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
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

5 participants