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

runtime: fatal error: missing stackmap #35355

Closed
FiloSottile opened this issue Nov 4, 2019 · 3 comments
Closed

runtime: fatal error: missing stackmap #35355

FiloSottile opened this issue Nov 4, 2019 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@FiloSottile
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version devel +9be36ba7b4 Mon Oct 28 19:33:24 2019 +0000 darwin/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/valsorda/Library/Caches/go-build"
GOENV="/Users/valsorda/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/valsorda"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org"
GOROOT="/Users/valsorda/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/valsorda/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/valsorda/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/df/mrk3bfz149n8zb5h5p1vp_1m00hbbm/T/go-build509847733=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

A simple go test in the crypto/tls package.

What did you see?

This failure happened randomly and frequently a few times, and then stopped being a problem by itself, I suppose as I changed the code layout?

I also got a fatal error: stopm holding locks once.

runtime: frame runtime.asyncPreempt untyped locals 0xc000110e00+0x178
fatal error: missing stackmap

runtime stack:
runtime.throw(0x1387e21, 0x10)
        /Users/valsorda/go/src/runtime/panic.go:1045 +0x72
runtime.getStackMap(0x700001995b68, 0x700001995c78, 0x13a9600, 0xc000025270, 0x5be65, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/valsorda/go/src/runtime/stack.go:1238 +0x839
runtime.scanframeworker(0x700001995b68, 0x700001995c78, 0xc000025270)
        /Users/valsorda/go/src/runtime/mgcmark.go:897 +0x7a
runtime.scanstack.func1(0x700001995b68, 0x0, 0x15f0060)
        /Users/valsorda/go/src/runtime/mgcmark.go:732 +0x3d
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc00007bc80, 0x0, 0x0, 0x7fffffff, 0x700001995c60, 0x0, 0x0, ...)
        /Users/valsorda/go/src/runtime/traceback.go:334 +0x1101
runtime.scanstack(0xc00007bc80, 0xc000025270)
        /Users/valsorda/go/src/runtime/mgcmark.go:735 +0x15e
runtime.markroot.func1()
        /Users/valsorda/go/src/runtime/mgcmark.go:228 +0xbf
runtime.markroot(0xc000025270, 0xc000000023)
        /Users/valsorda/go/src/runtime/mgcmark.go:201 +0x2f3
runtime.gcDrain(0xc000025270, 0x3)
        /Users/valsorda/go/src/runtime/mgcmark.go:995 +0x107
runtime.gcBgMarkWorker.func2()
        /Users/valsorda/go/src/runtime/mgc.go:1926 +0x80
runtime.systemstack(0x4600000)
        /Users/valsorda/go/src/runtime/asm_amd64.s:370 +0x66
runtime.mstart()
        /Users/valsorda/go/src/runtime/proc.go:1069

goroutine 26 [GC worker (idle)]:
runtime.systemstack_switch()
        /Users/valsorda/go/src/runtime/asm_amd64.s:330 fp=0xc000040f60 sp=0xc000040f58 pc=0x10611b0
runtime.gcBgMarkWorker(0xc000024000)
        /Users/valsorda/go/src/runtime/mgc.go:1913 +0x1be fp=0xc000040fd8 sp=0xc000040f60 pc=0x101d87e
runtime.goexit()
        /Users/valsorda/go/src/runtime/asm_amd64.s:1375 +0x1 fp=0xc000040fe0 sp=0xc000040fd8 pc=0x10632a1
created by runtime.gcBgMarkStartWorkers
        /Users/valsorda/go/src/runtime/mgc.go:1807 +0x77

goroutine 1 [chan receive]:
testing.(*T).Run(0xc00017da00, 0x138c1eb, 0x1a, 0x13a78f8, 0x10adc01)
        /Users/valsorda/go/src/testing/testing.go:977 +0x378
testing.runTests.func1(0xc00043c000)
        /Users/valsorda/go/src/testing/testing.go:1218 +0x78
testing.tRunner(0xc00043c000, 0xc000433d08)
        /Users/valsorda/go/src/testing/testing.go:925 +0xc1
testing.runTests(0xc0004361a0, 0x1626300, 0x82, 0x82, 0x0)
        /Users/valsorda/go/src/testing/testing.go:1216 +0x2a7
testing.(*M).Run(0xc0000ea080, 0x0)
        /Users/valsorda/go/src/testing/testing.go:1133 +0x15f
crypto/tls.runMain(0xc0000ea080, 0x0)
        /Users/valsorda/go/src/crypto/tls/handshake_test.go:389 +0x56e
crypto/tls.TestMain(0xc0000ea080)
        /Users/valsorda/go/src/crypto/tls/handshake_test.go:335 +0x82
main.main()
        _testmain.go:308 +0x135

goroutine 19 [IO wait]:
internal/poll.runtime_pollWait(0x42661d8, 0x72, 0x0)
        /Users/valsorda/go/src/runtime/netpoll.go:196 +0x55
internal/poll.(*pollDesc).wait(0xc0000ea118, 0x72, 0x0, 0x0, 0x1384937)
        /Users/valsorda/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
        /Users/valsorda/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0000ea100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/valsorda/go/src/internal/poll/fd_unix.go:384 +0x1d4
net.(*netFD).accept(0xc0000ea100, 0x37e11d600, 0x0, 0x0)
        /Users/valsorda/go/src/net/fd_unix.go:238 +0x42
net.(*TCPListener).accept(0xc0003ad740, 0xc000086cc0, 0xc0000407b0, 0x1)
        /Users/valsorda/go/src/net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc0003ad740, 0xc0000407b0, 0xc0000a8020, 0x0, 0x0)
        /Users/valsorda/go/src/net/tcpsock.go:261 +0x64
crypto/tls.localServer(0x140b920, 0xc0003ad740)
        /Users/valsorda/go/src/crypto/tls/handshake_test.go:249 +0x5f
created by crypto/tls.runMain
        /Users/valsorda/go/src/crypto/tls/handshake_test.go:361 +0x235

goroutine 59 [chan receive]:
testing.(*T).Run(0xc000472200, 0x13848ef, 0x6, 0xc0004db280, 0x10)
        /Users/valsorda/go/src/testing/testing.go:977 +0x378
crypto/tls.runTestAndUpdateIfNeeded(0xc00017da00, 0x13848ef, 0x6, 0xc000090f40, 0xc0000d2e00)
        /Users/valsorda/go/src/crypto/tls/handshake_test.go:51 +0x85
crypto/tls.runClientTestForVersion(0xc00017da00, 0xc0004d3e50, 0x13848ef, 0x6, 0x1384b45, 0x7)
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:510 +0x238
crypto/tls.runClientTestTLS13(...)
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:526
crypto/tls.TestHandshakeClientCertRSA(0xc00017da00)
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:770 +0x55c
testing.tRunner(0xc00017da00, 0x13a78f8)
        /Users/valsorda/go/src/testing/testing.go:925 +0xc1
created by testing.(*T).Run
        /Users/valsorda/go/src/testing/testing.go:976 +0x351

goroutine 162 [IO wait]:
internal/poll.runtime_pollWait(0x4265fd8, 0x72, 0xffffffffffffffff)
        /Users/valsorda/go/src/runtime/netpoll.go:196 +0x55
internal/poll.(*pollDesc).wait(0xc0004b6298, 0x72, 0x300, 0x328, 0xffffffffffffffff)
        /Users/valsorda/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
        /Users/valsorda/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0004b6280, 0xc0003fe700, 0x328, 0x328, 0x0, 0x0, 0x0)
        /Users/valsorda/go/src/internal/poll/fd_unix.go:169 +0x201
net.(*netFD).Read(0xc0004b6280, 0xc0003fe700, 0x328, 0x328, 0xc0000e1c88, 0xdf8475774, 0xbf68105a63ccbfc8)
        /Users/valsorda/go/src/net/fd_unix.go:202 +0x4f
net.(*conn).Read(0xc0000a8020, 0xc0003fe700, 0x328, 0x328, 0x0, 0x0, 0x0)
        /Users/valsorda/go/src/net/net.go:184 +0x8e
io.ReadAtLeast(0x4295048, 0xc0000a8020, 0xc0003fe700, 0x328, 0x328, 0x328, 0x162a280, 0x0, 0x0)
        /Users/valsorda/go/src/io/io.go:310 +0x87
io.ReadFull(...)
        /Users/valsorda/go/src/io/io.go:329
crypto/tls.(*clientTest).run(0xc0001da140, 0xc000472200, 0x5dbfc900)
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:453 +0x934
crypto/tls.(*clientTest).run-fm(0xc000472200, 0x23beb200)
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:277 +0x3d
crypto/tls.runTestAndUpdateIfNeeded.func1(0xc000472200)
        /Users/valsorda/go/src/crypto/tls/handshake_test.go:55 +0x4a
testing.tRunner(0xc000472200, 0xc0004db280)
        /Users/valsorda/go/src/testing/testing.go:925 +0xc1
created by testing.(*T).Run
        /Users/valsorda/go/src/testing/testing.go:976 +0x351

goroutine 163 [preempted (scan)]:
math/big.nat.norm(0xc0004f0690, 0x1a, 0x1e, 0xc0004f0690, 0x1a, 0x1e)
        /Users/valsorda/go/src/math/big/nat.go:52 +0x1a
math/big.nat.divLarge(0x0, 0x0, 0x0, 0xc0004f0690, 0x19, 0x1e, 0xc0004f0690, 0x19, 0x1e, 0xc000086840, ...)
        /Users/valsorda/go/src/math/big/nat.go:771 +0x73a
math/big.nat.div(0x0, 0x0, 0x0, 0xc0004f0690, 0x19, 0x1e, 0xc0004f0690, 0x19, 0x1e, 0xc000086840, ...)
        /Users/valsorda/go/src/math/big/nat.go:672 +0x401
math/big.(*Int).QuoRem(0xc0001112b8, 0xc00047b620, 0xc0000a0860, 0xc00047b620, 0x7, 0x10)
        /Users/valsorda/go/src/math/big/int.go:239 +0xbf
math/big.(*Int).Mod(0xc00047b620, 0xc00047b620, 0xc0000a0860, 0xc00047b620)
        /Users/valsorda/go/src/math/big/int.go:270 +0x10a
crypto/elliptic.(*CurveParams).addJacobian(0xc0000d2200, 0xc0000a0920, 0xc0000a0960, 0xc0001116d8, 0xc00047b5a0, 0xc00047b580, 0xc00047b5c0, 0xc00047b4c0, 0xc00047b4e0, 0xc00047b500)
        /Users/valsorda/go/src/crypto/elliptic/elliptic.go:181 +0x14a5
crypto/elliptic.(*CurveParams).ScalarMult(0xc0000d2200, 0xc0000a0920, 0xc0000a0960, 0xc000114a07, 0x41, 0x41, 0x1, 0xc000114a00)
        /Users/valsorda/go/src/crypto/elliptic/elliptic.go:260 +0x1c3
crypto/elliptic.(*CurveParams).ScalarBaseMult(0xc0000d2200, 0xc000114a07, 0x41, 0x41, 0x48, 0x48)
        /Users/valsorda/go/src/crypto/elliptic/elliptic.go:270 +0x5b
crypto/ecdsa.Verify(0xc0004db640, 0xc0003e6e40, 0x40, 0x40, 0xc0004db920, 0xc0004db940, 0x0)
        /Users/valsorda/go/src/crypto/ecdsa/ecdsa.go:273 +0x59d
crypto/tls.verifyHandshakeSignature(0xe3, 0x13499c0, 0xc0004db640, 0x7, 0xc0003e6e40, 0x40, 0x40, 0xc0003aa0a8, 0x8b, 0x98, ...)
        /Users/valsorda/go/src/crypto/tls/auth.go:37 +0x49e
crypto/tls.(*clientHandshakeStateTLS13).readServerCertificate(0xc000111be0, 0x0, 0x0)
        /Users/valsorda/go/src/crypto/tls/handshake_client_tls13.go:462 +0x36d
crypto/tls.(*clientHandshakeStateTLS13).handshake(0xc000111be0, 0xc0003c0600, 0x0)
        /Users/valsorda/go/src/crypto/tls/handshake_client_tls13.go:85 +0x1ee
crypto/tls.(*Conn).clientHandshake(0xc00017e380, 0x0, 0x0)
        /Users/valsorda/go/src/crypto/tls/handshake_client.go:196 +0x4d9
crypto/tls.(*Conn).Handshake(0xc00017e380, 0x0, 0x0)
        /Users/valsorda/go/src/crypto/tls/conn.go:1340 +0xcc
crypto/tls.(*Conn).Write(0xc00017e380, 0xc00001c0b0, 0x6, 0x6, 0x0, 0x0, 0x0)
        /Users/valsorda/go/src/crypto/tls/conn.go:1072 +0xa4
crypto/tls.(*clientTest).run.func3(0xc000108600, 0xc0001da140, 0x140ee00, 0xc000100010, 0xc000472200, 0xc00046f500, 0x0, 0x0)
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:315 +0x14a
created by crypto/tls.(*clientTest).run
        /Users/valsorda/go/src/crypto/tls/handshake_client_test.go:305 +0x29c
FAIL    crypto/tls      0.776s
FAIL
@FiloSottile FiloSottile added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 4, 2019
@FiloSottile FiloSottile added this to the Go1.14 milestone Nov 4, 2019
@randall77
Copy link
Contributor

@aclements

@cherrymui
Copy link
Member

This is a weird failure. The frame is runtime.asyncPreempt, but in this case scanframeworker should have returned at mgcmark.go:894, not calling getStackMap at mgcmark.go:897...

@ianlancetaylor
Copy link
Contributor

There have been a number of fixes, and I assume this hasn't happened again, so closing.

@golang golang locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants