Skip to content

runtime: spans corruption #7544

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
dvyukov opened this issue Mar 14, 2014 · 1 comment
Closed

runtime: spans corruption #7544

dvyukov opened this issue Mar 14, 2014 · 1 comment
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Mar 14, 2014

parent: 19465:08dcdcdb757b tip

go test -run=none -bench=.* -cpu=4 compress/flate
episodically crashes with:

MHeap_FreeLocked - span 0x7f4e8d505980 ptr 0xc2082d2000 state 1 ref 0 sweepgen 118/118
fatal error: MHeap_FreeLocked - invalid free

runtime stack:
runtime.throw(0x67b7c7)
    src/pkg/runtime/panic.c:519 +0x69
MHeap_FreeLocked(0x691140, 0x7f4e8d505980)
    src/pkg/runtime/mheap.c:409 +0x91
runtime.MHeap_Free(0x691140, 0x7f4e8d505980, 0x0)
    src/pkg/runtime/mheap.c:394 +0xa5
MCentral_ReturnToHeap(0x69d5d0, 0x7f4e8d505980)
    src/pkg/runtime/mcentral.c:306 +0xe7
runtime.MCentral_UncacheSpan(0x69d5d0, 0x7f4e8d505980)
    src/pkg/runtime/mcentral.c:127 +0x97
runtime.MCache_ReleaseAll(0x7f4e8d500000)
    src/pkg/runtime/mcache.c:120 +0x68
flushallmcaches()
    src/pkg/runtime/mgc0.c:2095 +0x5c
markroot(0xc20800e900, 0x4)
    src/pkg/runtime/mgc0.c:1326 +0x21b
runtime.parfordo(0xc20800e900)
    src/pkg/runtime/parfor.c:103 +0x128
runtime.gchelper()
    src/pkg/runtime/mgc0.c:2059 +0x2f
stopm()
    src/pkg/runtime/proc.c:960 +0x111
findrunnable()
    src/pkg/runtime/proc.c:1263 +0x42d
schedule()
    src/pkg/runtime/proc.c:1346 +0xe3
park0(0xc2080025a0)
    src/pkg/runtime/proc.c:1411 +0xfe
runtime.mcall(0x41bd37)
    src/pkg/runtime/asm_amd64.s:181 +0x4b



fatal error: MHeap_AllocLocked - MSpan not free

runtime stack:
runtime.throw(0x67b700)
    src/pkg/runtime/panic.c:519 +0x69
MHeap_AllocLocked(0x691140, 0x1, 0x32)
    src/pkg/runtime/mheap.c:231 +0xbf
runtime.MHeap_Alloc(0x691140, 0x1, 0x10000000032)
    src/pkg/runtime/mheap.c:178 +0x7b
MCentral_Grow(0x69d5d0)
    src/pkg/runtime/mcentral.c:265 +0x89
runtime.MCentral_CacheSpan(0x69d5d0)
    src/pkg/runtime/mcentral.c:84 +0x14b
runtime.MCache_Refill(0x7f8012295000, 0xc200000032)
    src/pkg/runtime/mcache.c:78 +0x119
runtime.mallocgc(0x2000, 0x0, 0x1e)
    src/pkg/runtime/malloc.goc:151 +0x2fc
runtime.stackalloc(0xc208002c60, 0x2000)
    src/pkg/runtime/stack.c:128 +0xc5
copystack(0xc208002c60, 0xc, 0x2000)
    src/pkg/runtime/stack.c:522 +0xb0
runtime.newstack()
    src/pkg/runtime/stack.c:667 +0x3c8
runtime.morestack()
    src/pkg/runtime/asm_amd64.s:228 +0x61



fatal error: empty span

goroutine 29 [running]:
runtime.throw(0x678fa0)
    src/pkg/runtime/panic.c:519 +0x69 fp=0xc208349c60
runtime.MCentral_CacheSpan(0x69c708)
    src/pkg/runtime/mcentral.c:94 +0x216 fp=0xc208349c90
runtime.MCache_Refill(0x7f204c91b000, 0xc200000027)
    src/pkg/runtime/mcache.c:78 +0x119 fp=0xc208349cc0
runtime.mallocgc(0xa00, 0x504500, 0x1)
    src/pkg/runtime/malloc.goc:151 +0x2fc fp=0xc208349d28
runtime.new(0x504500, 0xc2083e6400)
    src/pkg/runtime/malloc.goc:815 +0x32 fp=0xc208349d48
compress/flate.NewReader(0x7f204c92b970, 0xc2080223c0, 0x0, 0x0)
    src/pkg/compress/flate/inflate.go:686 +0x61 fp=0xc208349d78
compress/flate.benchmarkDecode(0xc2083e1a00, 0x1, 0xffffffffffffffff, 0x2710)
    src/pkg/compress/flate/reader_test.go:67 +0x669 fp=0xc208349ee8
compress/flate.BenchmarkDecodeTwainDefault1e4(0xc2083e1a00)
    src/pkg/compress/flate/reader_test.go:91 +0x42 fp=0xc208349f10
testing.(*B).runN(0xc2083e1a00, 0x3e8)
    src/pkg/testing/benchmark.go:124 +0x94 fp=0xc208349f20
testing.(*B).launch(0xc2083e1a00)
    src/pkg/testing/benchmark.go:214 +0x16c fp=0xc208349fa0
runtime.goexit()
    src/pkg/runtime/proc.c:1446 fp=0xc208349fa8
created by testing.(*B).run
    src/pkg/testing/benchmark.go:177 +0x40
@dvyukov
Copy link
Member Author

dvyukov commented Mar 14, 2014

Comment 1:

This issue was closed by revision 8d32162.

Status changed to Fixed.

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

3 participants