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: slice bounds panic in pageAlloc.update on 32-bit system #38371

Closed
rsc opened this issue Apr 10, 2020 · 2 comments
Closed

runtime: slice bounds panic in pageAlloc.update on 32-bit system #38371

rsc opened this issue Apr 10, 2020 · 2 comments
Labels
Milestone

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Apr 10, 2020

This program may be running out of memory,
but that should not cause a slice panic deep in
the allocator.

$ cat x.go
package main

var x []byte

func main() {
	for i := 0; i < 100; i++ {
		print(".")
		x = make([]byte, 1600e6)
	}
	println(x)
}
$ GOARCH=386 go run x.go
..fatal error: slice bounds out of range

runtime stack:
runtime.throw(0x80b1f3c, 0x19)
	/usr/local/google/home/rsc/go/src/runtime/panic.go:1114 +0x6a
runtime.panicCheck1(0x8067029, 0x80b1f3c, 0x19)
	/usr/local/google/home/rsc/go/src/runtime/panic.go:34 +0xb9
runtime.goPanicSliceBU(0x35d, 0xd9)
	/usr/local/google/home/rsc/go/src/runtime/panic.go:119 +0x37
runtime.(*pageAlloc).update(0x8103de4, 0xd7000000, 0x2fc00, 0x1)
	/usr/local/google/home/rsc/go/src/runtime/mpagealloc.go:430 +0x479
runtime.(*pageAlloc).grow(0x8103de4, 0xd7000000, 0x5f800000)
	/usr/local/google/home/rsc/go/src/runtime/mpagealloc.go:394 +0x175
runtime.(*mheap).grow(0x8103de0, 0x2faf1, 0x0)
	/usr/local/google/home/rsc/go/src/runtime/mheap.go:1336 +0x81
runtime.(*mheap).allocSpan(0x8103de0, 0x2faf1, 0x100, 0x81130e8, 0x5744ff84)
	/usr/local/google/home/rsc/go/src/runtime/mheap.go:1124 +0x5df
runtime.(*mheap).alloc.func1()
	/usr/local/google/home/rsc/go/src/runtime/mheap.go:871 +0x4c
runtime.(*mheap).alloc(0x8103de0, 0x2faf1, 0x8090101, 0x574000e0)
	/usr/local/google/home/rsc/go/src/runtime/mheap.go:865 +0x63
runtime.largeAlloc(0x5f5e1000, 0x57410101, 0x1)
	/usr/local/google/home/rsc/go/src/runtime/malloc.go:1163 +0x76
runtime.mallocgc.func1()
	/usr/local/google/home/rsc/go/src/runtime/malloc.go:1058 +0x39
runtime.systemstack(0x57400540)
	/usr/local/google/home/rsc/go/src/runtime/asm_386.s:395 +0x53
runtime.mstart()
	/usr/local/google/home/rsc/go/src/runtime/proc.go:1078

goroutine 1 [running]:
runtime.systemstack_switch()
	/usr/local/google/home/rsc/go/src/runtime/asm_386.s:356 fp=0x5743a748 sp=0x5743a744 pc=0x8094da0
runtime.mallocgc(0x5f5e1000, 0x80a4160, 0x8071401, 0x8112324)
	/usr/local/google/home/rsc/go/src/runtime/malloc.go:1057 +0x6a7 fp=0x5743a79c sp=0x5743a748 pc=0x8051727
runtime.makeslice(0x80a4160, 0x5f5e1000, 0x5f5e1000, 0x77800000)
	/usr/local/google/home/rsc/go/src/runtime/slice.go:49 +0x4f fp=0x5743a7b0 sp=0x5743a79c pc=0x80828ef
main.main()
	/usr/local/google/home/rsc/x.go:8 +0x6b fp=0x5743a7c8 sp=0x5743a7b0 pc=0x809934b
runtime.main()
	/usr/local/google/home/rsc/go/src/runtime/proc.go:204 +0x1fd fp=0x5743a7f0 sp=0x5743a7c8 pc=0x807221d
runtime.goexit()
exit status 2
$ 

/cc @aclements

@rsc rsc added the NeedsFix label Apr 10, 2020
@rsc rsc added this to the Go1.15 milestone Apr 10, 2020
@ALTree
Copy link
Member

@ALTree ALTree commented Apr 10, 2020

I believe this is a dup of #35954.

@aclements
Copy link
Member

@aclements aclements commented Apr 12, 2020

I agree. Closing as dup of #35954. /cc @mknyszek

@aclements aclements closed this Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.