Skip to content

runtime: fatal error: runtime: mcall called on m->g0 stack #6193

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
alberts opened this issue Aug 20, 2013 · 6 comments
Closed

runtime: fatal error: runtime: mcall called on m->g0 stack #6193

alberts opened this issue Aug 20, 2013 · 6 comments
Milestone

Comments

@alberts
Copy link
Contributor

alberts commented Aug 20, 2013

What steps will reproduce the problem?

go test -v -cpu 1,2,4 -timeout=60m std

What do you see instead?

=== RUN TestHandlerPanic-4
fatal error: runtime: mcall called on m->g0 stack

runtime stack:
runtime.throw(0xb049cb)
    /build/go.tip/go/src/pkg/runtime/panic.c:506 +0x69
runtime.badmcall()
    /build/go.tip/go/src/pkg/runtime/proc.c:2002 +0x27
runtime.mcall(0x419c20)
    /build/go.tip/go/src/pkg/runtime/asm_amd64.s:173 +0x39

goroutine 105326 [stack split]:
net/http_test.func·066()
    /build/go.tip/go/src/pkg/net/http/serve_test.go:1194 fp=0x7fbc8c2defa0
runtime.goexit()
    /build/go.tip/go/src/pkg/runtime/proc.c:1386 fp=0x7fbc8c2defa8
created by net/http_test.testHandlerPanic
    /build/go.tip/go/src/pkg/net/http/serve_test.go:1202 +0x2bf

goroutine 1 [chan receive]:
runtime.park(0x40cbd0, 0xc2105f14d0, 0xaff26d)
    /build/go.tip/go/src/pkg/runtime/proc.c:1334 +0x66
runtime.chanrecv(0x6b1380, 0xc2105f1480, 0x7fbc96bd6d18, 0x0, 0x0)
    /build/go.tip/go/src/pkg/runtime/chan.c:354 +0x50b
runtime.chanrecv1(0x6b1380, 0xc2105f1480, 0x7fbc96bd6e10, 0x1)
    /build/go.tip/go/src/pkg/runtime/chan.c:446 +0x38
testing.RunTests(0x828b48, 0xb05800, 0xa4, 0xa4, 0x1)
    /build/go.tip/go/src/pkg/testing/testing.go:470 +0x941
testing.Main(0x828b48, 0xb05800, 0xa4, 0xa4, 0xafeae0, ...)
    /build/go.tip/go/src/pkg/testing/testing.go:401 +0x96
main.main()
    net/http/_test/_testmain.go:409 +0x9c
runtime.main()
    /build/go.tip/go/src/pkg/runtime/proc.c:212 +0x11f
runtime.goexit()
    /build/go.tip/go/src/pkg/runtime/proc.c:1386

goroutine 2 [syscall]:
runtime.notetsleepg(0x7fbc96be5f60, 0xdf8475800)
    /build/go.tip/go/src/pkg/runtime/lock_futex.c:190 +0x46
runtime.MHeap_Scavenger()
    /build/go.tip/go/src/pkg/runtime/mheap.c:472 +0xa3
runtime.goexit()
    /build/go.tip/go/src/pkg/runtime/proc.c:1386
created by runtime.main
    /build/go.tip/go/src/pkg/runtime/proc.c:171

goroutine 3 [syscall]:
runtime.notetsleepg(0xb08f18, 0x5f5b188)
    /build/go.tip/go/src/pkg/runtime/lock_futex.c:190 +0x46
timerproc()
    /build/go.tip/go/src/pkg/runtime/time.goc:218 +0xbd
runtime.goexit()
    /build/go.tip/go/src/pkg/runtime/proc.c:1386
created by addtimer
    /build/go.tip/go/src/pkg/runtime/time.goc:90

goroutine 252 [finalizer wait]:
runtime.park(0x40cbd0, 0xb07980, 0xb01fdc)
    /build/go.tip/go/src/pkg/runtime/proc.c:1334 +0x66
runfinq()
    /build/go.tip/go/src/pkg/runtime/mgc0.c:2314 +0x84
runtime.goexit()
    /build/go.tip/go/src/pkg/runtime/proc.c:1386
created by runtime.gc
    /build/go.tip/go/src/pkg/runtime/mgc0.c:1996

goroutine 105324 [running]:
    goroutine running on other thread; stack unavailable
created by testing.RunTests
    /build/go.tip/go/src/pkg/testing/testing.go:469 +0x914

goroutine 105325 [IO wait]:
runtime.park(0x40cbd0, 0x7fbc96aa33c8, 0xafea76)
    /build/go.tip/go/src/pkg/runtime/proc.c:1334 +0x66
netpollblock(0x7fbc96aa33c0, 0x72)
    /build/go.tip/go/src/pkg/runtime/netpoll.goc:280 +0xa6
net.runtime_pollWait(0x7fbc96aa33c0, 0x72, 0x0)
    /build/go.tip/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(*pollDesc).Wait(0xc210686760, 0x72, 0x0, 0x0)
    /build/go.tip/go/src/pkg/net/fd_poll_runtime.go:81 +0x4c
net.(*pollDesc).WaitRead(0xc210686760, 0x0, 0x0)
    /build/go.tip/go/src/pkg/net/fd_poll_runtime.go:86 +0x42
net.(*netFD).accept(0xc210686700, 0x82ab60, 0x0, 0x7fbc96c0e268, 0xb)
    /build/go.tip/go/src/pkg/net/fd_unix.go:388 +0x366
net.(*TCPListener).AcceptTCP(0xc2102af750, 0x461275, 0x0, 0x0)
    /build/go.tip/go/src/pkg/net/tcpsock_posix.go:240 +0x6d
net.(*TCPListener).Accept(0xc2102af750, 0x0, 0x0, 0x0, 0x0)
    /build/go.tip/go/src/pkg/net/tcpsock_posix.go:250 +0x54
net/http/httptest.(*historyListener).Accept(0xc2100a6090, 0x0, 0x0, 0x0, 0x0)
    /build/go.tip/go/src/pkg/net/http/httptest/server.go:48 +0x9a
net/http.(*Server).Serve(0xc210a140f0, 0x7fbc96c17f30, 0xc2100a6090, 0x0, 0x0)
    /build/go.tip/go/src/pkg/net/http/server.go:1601 +0xad
runtime.goexit()
    /build/go.tip/go/src/pkg/runtime/proc.c:1386
created by net/http/httptest.(*Server).Start
    /build/go.tip/go/src/pkg/net/http/httptest/server.go:109 +0x2cf
FAIL    net/http    23.551s

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

6g

Which operating system are you using?

linux

Which version are you using?  (run 'go version')

go version devel +94ec271e7fce Tue Aug 20 14:33:03 2013 +1000 linux/amd64
@alberts
Copy link
Contributor Author

alberts commented Aug 20, 2013

Comment 1:

Title was meant to be:
runtime: fatal error: runtime: mcall called on m->g0 stack

@dvyukov
Copy link
Member

dvyukov commented Aug 20, 2013

Comment 2:

It may be related to the recent GC/g0 change.

Labels changed: added go1.2, removed priority-triage, go1.2maybe.

Status changed to Accepted.

@gopherbot
Copy link
Contributor

Comment 3 by keith.randall:

Yes, it may be related.  Unfortunately, it looks like stack traceback stops at the mcall
so we don't see what else is up there.  That sub-bug certainly needs fixing - we need to
somehow display the caller of mcall if mcall jumps to badmcall.

@dvyukov
Copy link
Member

dvyukov commented Aug 21, 2013

Comment 4:

Owner changed to @dvyukov.

Status changed to Started.

@dvyukov
Copy link
Member

dvyukov commented Aug 21, 2013

Comment 5:

This issue was closed by revision dfdd1ba.

Status changed to Fixed.

@calmh
Copy link
Contributor

calmh commented Sep 8, 2014

Comment 6:

This seems to have reappeared recently, on Solaris.
jb@zlogin3:~/go/src/runtime $ uname -a
SunOS zlogin3 5.11 joyent_20140821T185718Z i86pc i386 i86pc Solaris
jb@zlogin3:~/go/src/runtime $ hg id
e54b1af55910 tip
jb@zlogin3:~/go/src/runtime $ GOTRACEBACK=2 go test -cpu 1,2,4
fatal error: runtime: mcall called on m->g0 stack
runtime stack:
runtime.gothrow(0x697630, 0x24)
        /home/jb/go/src/runtime/panic1.go:178 +0x8e fp=0xfffffd7ffc5ffee0 sp=0xfffffd7ffc5ffec8
runtime.badmcall(0x6ba158)
        /home/jb/go/src/runtime/proc.go:109 +0x33 fp=0xfffffd7ffc5ffef8 sp=0xfffffd7ffc5ffee0
runtime.gopark(0x4318e0, 0x7b5a60, 0x668810, 0xa)
        /home/jb/go/src/runtime/proc.go:54 +0xbe fp=0xfffffd7ffc5fff20 sp=0xfffffd7ffc5ffef8
runtime.goparkunlock(0x7b5a60, 0x668810, 0xa)
        /home/jb/go/src/runtime/proc.go:60 +0x47 fp=0xfffffd7ffc5fff48 sp=0xfffffd7ffc5fff20
runtime.semacquire(0x7a40c8, 0x6ba000)
        /home/jb/go/src/runtime/sema.go:84 +0x1fb fp=0xfffffd7ffc5fff80 sp=0xfffffd7ffc5fff48
runtime.gomaxprocs_m()
        /home/jb/go/src/runtime/proc.c:2513 +0xb7 fp=0xfffffd7ffc5fffa0 sp=0xfffffd7ffc5fff80
runtime.onM(0xc209bf4900)
        /home/jb/go/src/runtime/asm_amd64.s:240 +0x78 fp=0xfffffd7ffc5fffa8 sp=0xfffffd7ffc5fffa0
runtime.mstart()
        /home/jb/go/src/runtime/proc.c:904 fp=0xfffffd7ffc5fffb0 sp=0xfffffd7ffc5fffa8
goroutine 12925 [running]:
runtime.switchtoM(0x6ba018)
        /home/jb/go/src/runtime/asm_amd64.s:197 fp=0xc209be5ee8 sp=0xc209be5ee0
runtime.GOMAXPROCS(0x1, 0x1)
        /home/jb/go/src/runtime/debug.go:29 +0x4a fp=0xc209be5f00 sp=0xc209be5ee8
runtime_test.TestPrintGC(0xc208066090)
        /home/jb/go/src/runtime/gc_test.go:292 +0x1ba fp=0xc209be5f70 sp=0xc209be5f00
testing.tRunner(0xc208066090, 0x7aca98)
        /home/jb/go/src/testing/testing.go:427 +0x8b fp=0xc209be5fa0 sp=0xc209be5f70
runtime.goexit()
        /home/jb/go/src/runtime/proc.c:1771 fp=0xc209be5fa8 sp=0xc209be5fa0
created by testing.RunTests
        /home/jb/go/src/testing/testing.go:509 +0x914
goroutine 1 [chan receive]:
runtime.gopark(0x4318e0, 0xc2080401d8, 0x663890, 0xc)
        /home/jb/go/src/runtime/proc.go:55 +0xbe fp=0xc20801bc10 sp=0xc20801bbe8
runtime.goparkunlock(0xc2080401d8, 0x663890, 0xc)
        /home/jb/go/src/runtime/proc.go:60 +0x47 fp=0xc20801bc38 sp=0xc20801bc10
runtime.chanrecv(0x598ce0, 0xc208040180, 0xc20801bdf0, 0x451e01, 0x0)
        /home/jb/go/src/runtime/chan.go:405 +0x361 fp=0xc20801bcb0 sp=0xc20801bc38
runtime.chanrecv1(0x598ce0, 0xc208040180, 0xc20801bdf0)
        /home/jb/go/src/runtime/chan.go:307 +0x2b fp=0xc20801bce0 sp=0xc20801bcb0
testing.RunTests(0x6b9d78, 0x7ac7e0, 0x6a, 0x6a, 0x1)
        /home/jb/go/src/testing/testing.go:510 +0x95f fp=0xc20801be78 sp=0xc20801bce0
testing.Main(0x6b9d78, 0x7ac7e0, 0x6a, 0x6a, 0x7ade20, 0xc2, 0xc2, 0x7b9760, 0x0, 0x0)
        /home/jb/go/src/testing/testing.go:440 +0x80 fp=0xc20801bef0 sp=0xc20801be78
main.main()
        runtime/_test/_testmain.go:645 +0x95 fp=0xc20801bf48 sp=0xc20801bef0
runtime.main()
        /home/jb/go/src/runtime/proc.c:279 +0x133 fp=0xc20801bfb0 sp=0xc20801bf48
runtime.goexit()
        /home/jb/go/src/runtime/proc.c:1771 fp=0xc20801bfb8 sp=0xc20801bfb0
goroutine 2 [force gc (idle)]:
runtime.gopark(0x4318e0, 0x7afbc0, 0x664bb0, 0xf)
        /home/jb/go/src/runtime/proc.go:55 +0xbe fp=0xc20801df68 sp=0xc20801df40
runtime.goparkunlock(0x7afbc0, 0x664bb0, 0xf)
        /home/jb/go/src/runtime/proc.go:60 +0x47 fp=0xc20801df90 sp=0xc20801df68
runtime.forcegchelper()
        /home/jb/go/src/runtime/proc.go:25 +0xba fp=0xc20801dfb0 sp=0xc20801df90
runtime.goexit()
        /home/jb/go/src/runtime/proc.c:1771 fp=0xc20801dfb8 sp=0xc20801dfb0
created by runtime.init·3
        /home/jb/go/src/runtime/proc.go:13 +0x24
goroutine 3 [GC sweep wait]:
runtime.park(0x4318e0, 0x7af0f0, 0x7ab1ce, 0xd)
        /home/jb/go/src/runtime/proc.c:1694 +0x8c fp=0xc208019f58 sp=0xc208019f40
runtime.parkunlock(0x7af0f0, 0x7ab1ce, 0xd)
        /home/jb/go/src/runtime/proc.c:1710 +0x47 fp=0xc208019f80 sp=0xc208019f58
bgsweep()
        /home/jb/go/src/runtime/mgc0.c:1075 +0xd0 fp=0xc208019fb0 sp=0xc208019f80
runtime.goexit()
        /home/jb/go/src/runtime/proc.c:1771 fp=0xc208019fb8 sp=0xc208019fb0
created by gc
        /home/jb/go/src/runtime/mgc0.c:1312
goroutine 4 [finalizer wait]:
runtime.gopark(0x4318e0, 0x7af298, 0x664610, 0xe)
        /home/jb/go/src/runtime/proc.go:55 +0xbe fp=0xc20803df18 sp=0xc20803def0
runtime.goparkunlock(0x7af298, 0x664610, 0xe)
        /home/jb/go/src/runtime/proc.go:60 +0x47 fp=0xc20803df40 sp=0xc20803df18
runtime.runfinq()
        /home/jb/go/src/runtime/malloc.go:704 +0xa6 fp=0xc20803dfb0 sp=0xc20803df40
runtime.goexit()
        /home/jb/go/src/runtime/proc.c:1771 fp=0xc20803dfb8 sp=0xc20803dfb0
created by runtime.createfing
        /home/jb/go/src/runtime/malloc.go:684 +0x5d
goroutine 10 [timer goroutine (idle)]:
runtime.gopark(0x4318e0, 0x7afec0, 0x67f870, 0x16)
        /home/jb/go/src/runtime/proc.go:55 +0xbe fp=0xc208039f18 sp=0xc208039ef0
runtime.goparkunlock(0x7afec0, 0x67f870, 0x16)
        /home/jb/go/src/runtime/proc.go:60 +0x47 fp=0xc208039f40 sp=0xc208039f18
runtime.timerproc()
        /home/jb/go/src/runtime/time.go:200 +0xbc fp=0xc208039fb0 sp=0xc208039f40
runtime.goexit()
        /home/jb/go/src/runtime/proc.c:1771 fp=0xc208039fb8 sp=0xc208039fb0
created by runtime.addtimerLocked
        /home/jb/go/src/runtime/time.go:113 +0x17c
goroutine 12926 [running]:
        goroutine running on other thread; stack unavailable
created by runtime_test.TestPrintGC
        /home/jb/go/src/runtime/gc_test.go:285 +0x17d
exit status 2
FAIL    runtime 31.617s

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
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