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: segmentation fault with growslice due to calculation overflow #21586

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

Comments

Projects
None yet
2 participants
@martisch
Copy link
Member

commented Aug 24, 2017

go tip ea5e3bd but also earlier

The calculation uintptr(newcap) * et.size in growslice
for the below example wraps around to 32 (4*1073741832) on 386:

type T [1<<27 + 1]int64

var d T
var s []T

func main() {
	s = append(s, d, d, d, d)
	print(len(s), "\n")
}
unexpected fault address 0x5044e000
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0x5044e000 pc=0x4402f]

Working on a fix in: https://golang.org/cl/55133

@martisch martisch added the NeedsFix label Aug 24, 2017

@martisch martisch self-assigned this Aug 24, 2017

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

@gopherbot

This comment has been minimized.

Copy link

commented Aug 25, 2017

Change https://golang.org/cl/55133 mentions this issue: runtime: protect growslice against newcap*et.size overflow

@gopherbot gopherbot closed this in 371a5b4 Nov 1, 2017

@golang golang locked and limited conversation to collaborators Nov 1, 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.