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

x/playground: conway's game of life gets fatal error runtime out of memory #28410

Closed
johandalabacka opened this issue Oct 26, 2018 · 1 comment

Comments

@johandalabacka
Copy link

Please answer these questions before submitting your issue. Thanks!

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

I'm using the playground on https://golang.org/#

Does this issue reproduce with the latest release?

I don't know the version on https://golang.org/#

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

What did you do?

Go to https://golang.org/# and in the play window select Conway's game of life and press Run.

What did you expect to see?

The program running.

What did you see instead?

go tool compile: exit status 2
fatal error: runtime: out of memory

runtime stack:
runtime.throw(0xcad06a, 0x16)
	/usr/local/go/src/runtime/panic.go:608 +0x72 fp=0x7ffdcac812d0 sp=0x7ffdcac812a0 pc=0x42aa72
runtime.sysMap(0xc000000000, 0x4000000, 0x1378398)
	/usr/local/go/src/runtime/mem_linux.go:156 +0xc7 fp=0x7ffdcac81310 sp=0x7ffdcac812d0 pc=0x4164b7
runtime.(*mheap).sysAlloc(0x13556e0, 0x4000000, 0x0, 0x0)
	/usr/local/go/src/runtime/malloc.go:619 +0x1c7 fp=0x7ffdcac81398 sp=0x7ffdcac81310 pc=0x40aa27
runtime.(*mheap).grow(0x13556e0, 0x1, 0x0)
	/usr/local/go/src/runtime/mheap.go:920 +0x42 fp=0x7ffdcac813f0 sp=0x7ffdcac81398 pc=0x4227c2
runtime.(*mheap).allocSpanLocked(0x13556e0, 0x1, 0x13783a8, 0x0)
	/usr/local/go/src/runtime/mheap.go:848 +0x337 fp=0x7ffdcac81430 sp=0x7ffdcac813f0 pc=0x422647
runtime.(*mheap).alloc_m(0x13556e0, 0x1, 0x2a, 0x0)
	/usr/local/go/src/runtime/mheap.go:692 +0x119 fp=0x7ffdcac81470 sp=0x7ffdcac81430 pc=0x421e59
runtime.(*mheap).alloc.func1()
	/usr/local/go/src/runtime/mheap.go:759 +0x4c fp=0x7ffdcac814a8 sp=0x7ffdcac81470 pc=0x453edc
runtime.(*mheap).alloc(0x13556e0, 0x1, 0x1002a, 0x0)
	/usr/local/go/src/runtime/mheap.go:758 +0x8a fp=0x7ffdcac814f8 sp=0x7ffdcac814a8 pc=0x4220fa
runtime.(*mcentral).grow(0x1357498, 0x0)
	/usr/local/go/src/runtime/mcentral.go:232 +0x94 fp=0x7ffdcac81540 sp=0x7ffdcac814f8 pc=0x415eb4
runtime.(*mcentral).cacheSpan(0x1357498, 0x7f60ea4c5000)
	/usr/local/go/src/runtime/mcentral.go:106 +0x2f8 fp=0x7ffdcac81588 sp=0x7ffdcac81540 pc=0x415a08
runtime.(*mcache).refill(0x7f60ea4c5000, 0x2a)
	/usr/local/go/src/runtime/mcache.go:122 +0x95 fp=0x7ffdcac815b8 sp=0x7ffdcac81588 pc=0x4155c5
runtime.(*mcache).nextFree.func1()
	/usr/local/go/src/runtime/malloc.go:749 +0x32 fp=0x7ffdcac815d8 sp=0x7ffdcac815b8 pc=0x4532f2
runtime.(*mcache).nextFree(0x7f60ea4c5000, 0x137842a, 0x4000, 0x7f60ea4c5000, 0x7ffdcac81698)
	/usr/local/go/src/runtime/malloc.go:748 +0xb6 fp=0x7ffdcac81630 sp=0x7ffdcac815d8 pc=0x40b0d6
runtime.mallocgc(0x180, 0xc97fa0, 0x7ffdcac81601, 0x7f60ea4c9000)
	/usr/local/go/src/runtime/malloc.go:903 +0x793 fp=0x7ffdcac816d0 sp=0x7ffdcac81630 pc=0x40ba23
runtime.newobject(0xc97fa0, 0x1378400)
	/usr/local/go/src/runtime/malloc.go:1032 +0x38 fp=0x7ffdcac81700 sp=0x7ffdcac816d0 pc=0x40be08
runtime.malg(0x7f6000008000, 0x7f60ea4c5000)
	/usr/local/go/src/runtime/proc.go:3285 +0x31 fp=0x7ffdcac81740 sp=0x7ffdcac81700 pc=0x433df1
runtime.mpreinit(0x1347ec0)
	/usr/local/go/src/runtime/os_linux.go:311 +0x29 fp=0x7ffdcac81760 sp=0x7ffdcac81740 pc=0x428ea9
runtime.mcommoninit(0x1347ec0)
	/usr/local/go/src/runtime/proc.go:624 +0xc1 fp=0x7ffdcac81798 sp=0x7ffdcac81760 pc=0x42d8a1
runtime.schedinit()
	/usr/local/go/src/runtime/proc.go:546 +0x89 fp=0x7ffdcac81800 sp=0x7ffdcac81798 pc=0x42d569
runtime.rt0_go(0x7ffdcac81838, 0x2, 0x7ffdcac81838, 0x0, 0x0, 0x2, 0x7ffdcac82e9b, 0x7ffdcac82ec6, 0x0, 0x7ffdcac82ece, ...)
	/usr/local/go/src/runtime/asm_amd64.s:195 +0x11a fp=0x7ffdcac81808 sp=0x7ffdcac81800 pc=0x455b7a
go tool compile: exit status 2
fatal error: runtime: out of memory

runtime stack:
runtime.throw(0xcad06a, 0x16)
	/usr/local/go/src/runtime/panic.go:608 +0x72 fp=0x7ffffa725ad0 sp=0x7ffffa725aa0 pc=0x42aa72
runtime.sysMap(0xc000000000, 0x4000000, 0x1378398)
	/usr/local/go/src/runtime/mem_linux.go:156 +0xc7 fp=0x7ffffa725b10 sp=0x7ffffa725ad0 pc=0x4164b7
runtime.(*mheap).sysAlloc(0x13556e0, 0x4000000, 0x0, 0x0)
	/usr/local/go/src/runtime/malloc.go:619 +0x1c7 fp=0x7ffffa725b98 sp=0x7ffffa725b10 pc=0x40aa27
runtime.(*mheap).grow(0x13556e0, 0x1, 0x0)
	/usr/local/go/src/runtime/mheap.go:920 +0x42 fp=0x7ffffa725bf0 sp=0x7ffffa725b98 pc=0x4227c2
runtime.(*mheap).allocSpanLocked(0x13556e0, 0x1, 0x13783a8, 0x0)
	/usr/local/go/src/runtime/mheap.go:848 +0x337 fp=0x7ffffa725c30 sp=0x7ffffa725bf0 pc=0x422647
runtime.(*mheap).alloc_m(0x13556e0, 0x1, 0x2a, 0x0)
	/usr/local/go/src/runtime/mheap.go:692 +0x119 fp=0x7ffffa725c70 sp=0x7ffffa725c30 pc=0x421e59
runtime.(*mheap).alloc.func1()
	/usr/local/go/src/runtime/mheap.go:759 +0x4c fp=0x7ffffa725ca8 sp=0x7ffffa725c70 pc=0x453edc
runtime.(*mheap).alloc(0x13556e0, 0x1, 0x1002a, 0x0)
	/usr/local/go/src/runtime/mheap.go:758 +0x8a fp=0x7ffffa725cf8 sp=0x7ffffa725ca8 pc=0x4220fa
runtime.(*mcentral).grow(0x1357498, 0x0)
	/usr/local/go/src/runtime/mcentral.go:232 +0x94 fp=0x7ffffa725d40 sp=0x7ffffa725cf8 pc=0x415eb4
runtime.(*mcentral).cacheSpan(0x1357498, 0x7fcf7973d000)
	/usr/local/go/src/runtime/mcentral.go:106 +0x2f8 fp=0x7ffffa725d88 sp=0x7ffffa725d40 pc=0x415a08
runtime.(*mcache).refill(0x7fcf7973d000, 0x2a)
	/usr/local/go/src/runtime/mcache.go:122 +0x95 fp=0x7ffffa725db8 sp=0x7ffffa725d88 pc=0x4155c5
runtime.(*mcache).nextFree.func1()
	/usr/local/go/src/runtime/malloc.go:749 +0x32 fp=0x7ffffa725dd8 sp=0x7ffffa725db8 pc=0x4532f2
runtime.(*mcache).nextFree(0x7fcf7973d000, 0x137842a, 0x4000, 0x7fcf7973d000, 0x7ffffa725e98)
	/usr/local/go/src/runtime/malloc.go:748 +0xb6 fp=0x7ffffa725e30 sp=0x7ffffa725dd8 pc=0x40b0d6
runtime.mallocgc(0x180, 0xc97fa0, 0x7ffffa725e01, 0x7fcf79741000)
	/usr/local/go/src/runtime/malloc.go:903 +0x793 fp=0x7ffffa725ed0 sp=0x7ffffa725e30 pc=0x40ba23
runtime.newobject(0xc97fa0, 0x1378400)
	/usr/local/go/src/runtime/malloc.go:1032 +0x38 fp=0x7ffffa725f00 sp=0x7ffffa725ed0 pc=0x40be08
runtime.malg(0x7fcf00008000, 0x7fcf7973d000)
	/usr/local/go/src/runtime/proc.go:3285 +0x31 fp=0x7ffffa725f40 sp=0x7ffffa725f00 pc=0x433df1
runtime.mpreinit(0x1347ec0)
	/usr/local/go/src/runtime/os_linux.go:311 +0x29 fp=0x7ffffa725f60 sp=0x7ffffa725f40 pc=0x428ea9
runtime.mcommoninit(0x1347ec0)
	/usr/local/go/src/runtime/proc.go:624 +0xc1 fp=0x7ffffa725f98 sp=0x7ffffa725f60 pc=0x42d8a1
runtime.schedinit()
	/usr/local/go/src/runtime/proc.go:546 +0x89 fp=0x7ffffa726000 sp=0x7ffffa725f98 pc=0x42d569
runtime.rt0_go(0x7ffffa726038, 0x2, 0x7ffffa726038, 0x0, 0x0, 0x2, 0x7ffffa727e9b, 0x7ffffa727ec6, 0x0, 0x7ffffa727ece, ...)
	/usr/local/go/src/runtime/asm_amd64.s:195 +0x11a fp=0x7ffffa726008 sp=0x7ffffa726000 pc=0x455b7a

Program exited.

However if I change

func main() {
	l := NewLife(40, 15)

in to

func main() {
	l := NewLife(10, 10)

Will it work

@ysmolski
Copy link
Member

duplicate of #28283

@ysmolski ysmolski changed the title Conway's game of life gets fatal error runtime out of memory x/playground: conway's game of life gets fatal error runtime out of memory Oct 26, 2018
@golang golang locked and limited conversation to collaborators Oct 26, 2019
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