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: infinite loop in growslice due to overflow #21441

Closed
martisch opened this issue Aug 14, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@martisch
Copy link
Member

commented Aug 14, 2017

This loop in growslice can loop for a very long (minutes, possibly infinitly) time due to overflow with very high cap sizes:
https://github.com/golang/go/blob/master/src/runtime/slice.go#L108

Can be triggered on Darwin GOARCH=386 tip 816deac with:

x = make([]byte, 1<<30-1, 1<<30-1)
x = append(x, x...)

https://play.golang.org/p/Y-P-O4yWno

Assigning myself to work on a CL to guard that loop from overflow.

/cc @randall77 @josharian

@martisch martisch self-assigned this Aug 14, 2017

@martisch martisch added the NeedsFix label Aug 14, 2017

@martisch martisch added this to the Go1.10 milestone Aug 14, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Aug 23, 2017

Change https://golang.org/cl/57950 mentions this issue: runtime: avoid infinite loop in growslice

@gopherbot gopherbot closed this in f3e0d14 Aug 24, 2017

@golang golang locked and limited conversation to collaborators Aug 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.