Skip to content

runtime: cannot allocate memory on Plan 9 #9803

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
0intro opened this issue Feb 7, 2015 · 1 comment
Closed

runtime: cannot allocate memory on Plan 9 #9803

0intro opened this issue Feb 7, 2015 · 1 comment

Comments

@0intro
Copy link
Member

0intro commented Feb 7, 2015

The runtime/pprof trace_parser_test.go and trace_test.go
test files were added in CL 2039.

These new tests were failing and emphasized an issue
in the memory allocator on Plan 9 that could lead
to a corruption (issue #9712).

Dmitry Vyukov (@dvyukov) kindly fixed the memory allocator
on Plan 9 in CL 3602.

However, the TestTrace test is still randomly failing.

For example:

http://build.golang.org/log/f3be10946ca4bd08b55b6fb0e4169f10058a059c

fatal error: runtime: cannot allocate memory

runtime stack:
runtime.throw(0x1a68a8, 0x1f)
    /tmp/buildlet-scatch183758248/go/src/runtime/panic.go:511 +0x71
runtime.persistentalloc(0x4000, 0x8, 0x276f98, 0x19eaa)
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:634 +0x1ec
runtime.fixAlloc_Alloc(0x267d40, 0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/mfixalloc.go:39 +0xc8
runtime.mHeap_AllocSpanLocked(0x260e40, 0x1, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:308 +0x155
runtime.mHeap_Alloc_m(0x260e40, 0x1, 0x6, 0xb400, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:193 +0x125
runtime.func·034()
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:233 +0x51
runtime.systemstack(0xdfffec5c)
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:270 +0x7f
runtime.mHeap_Alloc(0x260e40, 0x1, 0x6, 0x100, 0xb267)
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:234 +0x5f
runtime.mCentral_Grow(0x264f80, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mcentral.go:179 +0x89
runtime.mCentral_CacheSpan(0x264f80, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mcentral.go:75 +0x2e4
runtime.mCache_Refill(0x30384000, 0x6, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mcache.go:70 +0xa6
runtime.func·003()
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:161 +0x39
runtime.systemstack(0x1039c000)
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:254 +0x56
runtime.mstart()
    /tmp/buildlet-scatch183758248/go/src/runtime/proc1.go:671

goroutine 50 [running]:
runtime.systemstack_switch()
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:209 fp=0x1039fc98 sp=0x1039fc94
runtime.mallocgc(0x50, 0x16e6c0, 0x0, 0x1787df90)
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:162 +0x45c fp=0x1039fcf4 sp=0x1039fc98
runtime.newobject(0x16e6c0, 0x1787df90)
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:259 +0x47 fp=0x1039fd08 sp=0x1039fcf4
runtime/pprof_test.parseEvents(0x18d5e000, 0x52b7b, 0x58ccc, 0x177e4000, 0x186da, 0x1e000, 0x0, 0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/pprof/trace_parser_test.go:212 +0xa6d fp=0x1039fe98 sp=0x1039fd08
runtime/pprof_test.parseTrace(0x303a6f20, 0x103f5e60, 0x0, 0x0, 0x0, 0x0, 0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/pprof/trace_parser_test.go:63 +0xb8 fp=0x1039fedc sp=0x1039fe98
runtime/pprof_test.TestTraceStress(0x103f5e00)
    /tmp/buildlet-scatch183758248/go/src/runtime/pprof/trace_test.go:201 +0xb24 fp=0x1039ffb4 sp=0x1039fedc
testing.tRunner(0x103f5e00, 0x25a338)
    /tmp/buildlet-scatch183758248/go/src/testing/testing.go:448 +0xb4 fp=0x1039ffe8 sp=0x1039ffb4
runtime.goexit()
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:2414 +0x1 fp=0x1039ffec sp=0x1039ffe8
created by testing.RunTests
    /tmp/buildlet-scatch183758248/go/src/testing/testing.go:556 +0x833

goroutine 1 [chan receive]:
testing.RunTests(0x1d12d8, 0x25a2c0, 0xc, 0xc, 0x1)
    /tmp/buildlet-scatch183758248/go/src/testing/testing.go:557 +0x86b
testing.(*M).Run(0x103d4060, 0x270060)
    /tmp/buildlet-scatch183758248/go/src/testing/testing.go:486 +0x5d
main.main()
    runtime/pprof/_test/_testmain.go:76 +0x176

goroutine 82 [select (no cases)]:
runtime/pprof_test.func·025()
    /tmp/buildlet-scatch183758248/go/src/runtime/pprof/trace_test.go:189 +0x22
created by runtime/pprof_test.TestTraceStress
    /tmp/buildlet-scatch183758248/go/src/runtime/pprof/trace_test.go:190 +0xa13
fatal error: malloc deadlock
panic during panic

runtime stack:
runtime.startpanic_m()
    /tmp/buildlet-scatch183758248/go/src/runtime/panic1.go:66 +0x11b
runtime.systemstack(0x1d14ec)
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:270 +0x7f
runtime.startpanic()
    /tmp/buildlet-scatch183758248/go/src/runtime/panic.go:489 +0x10
runtime.throw(0x18fd18, 0xf)
    /tmp/buildlet-scatch183758248/go/src/runtime/panic.go:510 +0x65
runtime.mallocgc(0x8, 0x0, 0x3, 0xbe)
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:69 +0x8d
runtime.rawbyteslice(0x1, 0x0, 0x0, 0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/string.go:274 +0x77
runtime.stringtoslicebyte(0xdfffeb16, 0x1, 0x0, 0x0, 0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/string.go:133 +0x3f
runtime.exit(0x2)
    /tmp/buildlet-scatch183758248/go/src/runtime/os1_plan9.go:185 +0x109
runtime.dopanic_m(0x10382e60, 0x1ffb1, 0xdfffebb0)
    /tmp/buildlet-scatch183758248/go/src/runtime/panic1.go:121 +0x21b
runtime.func·043()
    /tmp/buildlet-scatch183758248/go/src/runtime/panic.go:498 +0x3e
runtime.systemstack(0xdfffeb9c)
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:270 +0x7f
runtime.dopanic(0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/panic.go:499 +0x56
runtime.throw(0x1a68a8, 0x1f)
    /tmp/buildlet-scatch183758248/go/src/runtime/panic.go:511 +0x71
runtime.persistentalloc(0x4000, 0x8, 0x276f98, 0x19eaa)
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:634 +0x1ec
runtime.fixAlloc_Alloc(0x267d40, 0x0)
    /tmp/buildlet-scatch183758248/go/src/runtime/mfixalloc.go:39 +0xc8
runtime.mHeap_AllocSpanLocked(0x260e40, 0x1, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:308 +0x155
runtime.mHeap_Alloc_m(0x260e40, 0x1, 0x6, 0xb400, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:193 +0x125
runtime.func·034()
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:233 +0x51
runtime.systemstack(0xdfffec5c)
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:270 +0x7f
runtime.mHeap_Alloc(0x260e40, 0x1, 0x6, 0x100, 0xb267)
    /tmp/buildlet-scatch183758248/go/src/runtime/mheap.go:234 +0x5f
runtime.mCentral_Grow(0x264f80, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mcentral.go:179 +0x89
runtime.mCentral_CacheSpan(0x264f80, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mcentral.go:75 +0x2e4
runtime.mCache_Refill(0x30384000, 0x6, 0x303c085c)
    /tmp/buildlet-scatch183758248/go/src/runtime/mcache.go:70 +0xa6
runtime.func·003()
    /tmp/buildlet-scatch183758248/go/src/runtime/malloc.go:161 +0x39
runtime.systemstack(0x1039c000)
    /tmp/buildlet-scatch183758248/go/src/runtime/asm_386.s:254 +0x56
runtime.mstart()
    /tmp/buildlet-scatch183758248/go/src/runtime/proc1.go:671
fatal error: unexpected signal during runtime execution
stack trace unavailable
fatal error: malloc deadlock
[...]
fatal error: malloc deadlock
pprof.test 2266: suicide: sys: breakpoint pc=0x00040567
*** Test killed: ran too long (5m0s).
FAIL    runtime/pprof   300.052s
@0intro 0intro self-assigned this Feb 7, 2015
@dvyukov
Copy link
Member

dvyukov commented Feb 7, 2015

This can be due to #9736

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