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
Closed

runtime: infinite loop in growslice due to overflow #21441

martisch opened this issue Aug 14, 2017 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@martisch
Copy link
Contributor

martisch 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 The path to resolution is known, but the work has not been done. label Aug 14, 2017
@martisch martisch added this to the Go1.10 milestone Aug 14, 2017
@gopherbot
Copy link

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

@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.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants