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: lock ordering problem between assistQueue and mspanSpecial #39022

Closed
bcmills opened this issue May 12, 2020 · 1 comment
Closed

runtime: lock ordering problem between assistQueue and mspanSpecial #39022

bcmills opened this issue May 12, 2020 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented May 12, 2020

https://build.golang.org/log/8e91ad619015035d7f1318856b68de9092b7c4e0

--- FAIL: TestTestVetRebuild (0.20s)
    go_test.go:2511: running testgo [test b]
    go_test.go:2511: standard error:
    go_test.go:2511: 59214  ======
        0 : assistQueue 4 0xdcfb78
        1 : mspanSpecial 21 0x7f12302bf720
        fatal error: lock ordering problem
        
        runtime stack:
        runtime.throw(0xa3da16, 0x15)
        	/workdir/go/src/runtime/panic.go:1116 +0x72
        runtime.checkRanks(0xc0001f4600, 0x4, 0x15)
        	/workdir/go/src/runtime/lockrank_on.go:137 +0x27e
        runtime.lockWithRank.func1()
        	/workdir/go/src/runtime/lockrank_on.go:79 +0xbc
        runtime.lockWithRank(0x7f12302bf720, 0x15)
        	/workdir/go/src/runtime/lockrank_on.go:68 +0x8e
        runtime.lock(...)
        	/workdir/go/src/runtime/lock_futex.go:47
        runtime.addspecial(0xc0001a8480, 0x7f1205f32150, 0x7f1205e70a38)
        	/workdir/go/src/runtime/mheap.go:1674 +0xa5
        runtime.setprofilebucket(0xc0001a8480, 0x7f1206128b88)
        	/workdir/go/src/runtime/mheap.go:1826 +0x8d
        runtime.mProf_Malloc.func1()
        	/workdir/go/src/runtime/mprof.go:357 +0x33
        runtime.mProf_Malloc(0xc0001a8480, 0x180)
        	/workdir/go/src/runtime/mprof.go:356 +0x1a9
        runtime.profilealloc(0xc000080c00, 0xc0001a8480, 0x180)
        	/workdir/go/src/runtime/malloc.go:1234 +0x70
        runtime.mallocgc(0x180, 0xa2fde0, 0x1, 0x7f1205e70ce8)
        	/workdir/go/src/runtime/malloc.go:1138 +0x4ab
        runtime.newobject(0xa2fde0, 0xad6ac62b882dd4ec)
        	/workdir/go/src/runtime/malloc.go:1193 +0x38
        runtime.malg(0xc0ffffffff, 0xc000081400)
        	/workdir/go/src/runtime/proc.go:3442 +0x31
        runtime.allocm(0xc000033000, 0xa801f8, 0xc0001f4600)
        	/workdir/go/src/runtime/proc.go:1454 +0x172
        runtime.newm(0xa801f8, 0xc000033000)
        	/workdir/go/src/runtime/proc.go:1761 +0x39
        runtime.startm(0x0, 0xc00059a101)
        	/workdir/go/src/runtime/proc.go:1926 +0x13d
        runtime.wakep()
        	/workdir/go/src/runtime/proc.go:2013 +0x66
        runtime.ready(0xc00059a180, 0x0, 0x428200)
        	/workdir/go/src/runtime/proc.go:693 +0xb6
        runtime.gcFlushBgCredit(0x7d0)
        	/workdir/go/src/runtime/mgcmark.go:757 +0x9b
        runtime.gcDrain(0xc000036e98, 0x7)
        	/workdir/go/src/runtime/mgcmark.go:1150 +0x2fd
        runtime.gcBgMarkWorker.func2()
        	/workdir/go/src/runtime/mgc.go:1981 +0x185
        runtime.systemstack(0x0)
        	/workdir/go/src/runtime/asm_amd64.s:370 +0x66
        runtime.mstart()
        	/workdir/go/src/runtime/proc.go:1100
        
        goroutine 67 [GC worker (idle)]:
        runtime.systemstack_switch()
        	/workdir/go/src/runtime/asm_amd64.s:330 fp=0xc000038760 sp=0xc000038758 pc=0x46b760
        runtime.gcBgMarkWorker(0xc000035800)
        	/workdir/go/src/runtime/mgc.go:1945 +0x1be fp=0xc0000387d8 sp=0xc000038760 pc=0x41f5de
        runtime.goexit()
        	/workdir/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc0000387e0 sp=0xc0000387d8 pc=0x46d541
        created by runtime.gcBgMarkStartWorkers
        	/workdir/go/src/runtime/mgc.go:1839 +0x77
        59214  ======
        0 : assistQueue 4 0xdcfb78
        1 : mspanSpecial 21 0x7f12302bf720
        2 : allg 10 0xe02db0
        fatal error: lock ordering problem
        panic during panic
        
        runtime stack:
        runtime.throw(0xa3da16, 0x15)
        	/workdir/go/src/runtime/panic.go:1116 +0x72
        runtime.checkRanks(0xc0001f4600, 0x15, 0xa)
        	/workdir/go/src/runtime/lockrank_on.go:137 +0x27e
        runtime.lockWithRank.func1()
        	/workdir/go/src/runtime/lockrank_on.go:79 +0xbc
        runtime.lockWithRank(0xe02db0, 0xa)
        	/workdir/go/src/runtime/lockrank_on.go:68 +0x8e
        runtime.lock(...)
        	/workdir/go/src/runtime/lock_futex.go:47
        runtime.tracebackothers(0xc0001f4600)
        	/workdir/go/src/runtime/traceback.go:929 +0x93
        runtime.dopanic_m(0xc0001f4600, 0x4378d2, 0x7f1205e708b8, 0x1)
        	/workdir/go/src/runtime/panic.go:1322 +0x2dd
        runtime.fatalthrow.func1()
        	/workdir/go/src/runtime/panic.go:1171 +0x5f
        runtime.fatalthrow()
        	/workdir/go/src/runtime/panic.go:1168 +0x57
        runtime.throw(0xa3da16, 0x15)
        	/workdir/go/src/runtime/panic.go:1116 +0x72
        runtime.checkRanks(0xc0001f4600, 0x4, 0x15)
        	/workdir/go/src/runtime/lockrank_on.go:137 +0x27e
        runtime.lockWithRank.func1()
        	/workdir/go/src/runtime/lockrank_on.go:79 +0xbc
        runtime.lockWithRank(0x7f12302bf720, 0x15)
        	/workdir/go/src/runtime/lockrank_on.go:68 +0x8e
        runtime.lock(...)
        	/workdir/go/src/runtime/lock_futex.go:47
        runtime.addspecial(0xc0001a8480, 0x7f1205f32150, 0x7f1205e70a38)
        	/workdir/go/src/runtime/mheap.go:1674 +0xa5
        runtime.setprofilebucket(0xc0001a8480, 0x7f1206128b88)
        	/workdir/go/src/runtime/mheap.go:1826 +0x8d
        runtime.mProf_Malloc.func1()
        	/workdir/go/src/runtime/mprof.go:357 +0x33
        runtime.mProf_Malloc(0xc0001a8480, 0x180)
        	/workdir/go/src/runtime/mprof.go:356 +0x1a9
        runtime.profilealloc(0xc000080c00, 0xc0001a8480, 0x180)
        	/workdir/go/src/runtime/malloc.go:1234 +0x70
        runtime.mallocgc(0x180, 0xa2fde0, 0x1, 0x7f1205e70ce8)
        	/workdir/go/src/runtime/malloc.go:1138 +0x4ab
        runtime.newobject(0xa2fde0, 0xad6ac62b882dd4ec)
        	/workdir/go/src/runtime/malloc.go:1193 +0x38
        runtime.malg(0xc0ffffffff, 0xc000081400)
        	/workdir/go/src/runtime/proc.go:3442 +0x31
        runtime.allocm(0xc000033000, 0xa801f8, 0xc0001f4600)
        	/workdir/go/src/runtime/proc.go:1454 +0x172
        runtime.newm(0xa801f8, 0xc000033000)
        	/workdir/go/src/runtime/proc.go:1761 +0x39
        runtime.startm(0x0, 0xc00059a101)
        	/workdir/go/src/runtime/proc.go:1926 +0x13d
        runtime.wakep()
        	/workdir/go/src/runtime/proc.go:2013 +0x66
        runtime.ready(0xc00059a180, 0x0, 0x428200)
        	/workdir/go/src/runtime/proc.go:693 +0xb6
        runtime.gcFlushBgCredit(0x7d0)
        	/workdir/go/src/runtime/mgcmark.go:757 +0x9b
        runtime.gcDrain(0xc000036e98, 0x7)
        	/workdir/go/src/runtime/mgcmark.go:1150 +0x2fd
        runtime.gcBgMarkWorker.func2()
        	/workdir/go/src/runtime/mgc.go:1981 +0x185
        runtime.systemstack(0x0)
        	/workdir/go/src/runtime/asm_amd64.s:370 +0x66
        runtime.mstart()
        	/workdir/go/src/runtime/proc.go:1100
        
    go_test.go:2511: go [test b] failed unexpectedly in /workdir/go/src/cmd/go: exit status 2
FAIL
2020/05/12 15:11:13 unexpected files left in tmpdir: [go-build124149088 go-build731527877]
FAIL	cmd/go	45.168s

CC @danscales @mknyszek

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels May 12, 2020
@bcmills bcmills added this to the Go1.15 milestone May 12, 2020
@danscales danscales self-assigned this May 12, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/233599 mentions this issue: runtime: add a lock partial order edge (assistQueue -> mspanSpecial)

@golang golang locked and limited conversation to collaborators May 14, 2021
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. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants