-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: panic when accessing an empty struct value appended to an uninitialised slice #10135
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
Labels
Milestone
Comments
the problem is that append returns a slice with ptr=nil. |
I've sent https://golang.org/cl/7400 |
CL https://golang.org/cl/14248 mentions this issue. |
minux
added a commit
that referenced
this issue
Sep 22, 2015
… non-zero len from growslice Fixes #10135. Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e Signed-off-by: Shenghou Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/7400 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/14248 Reviewed-by: Andrew Gerrand <[email protected]>
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
… non-zero len from growslice Fixes golang#10135. Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e Signed-off-by: Shenghou Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/7400 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/14248 Reviewed-by: Andrew Gerrand <[email protected]>
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 26, 2018
… non-zero len from growslice Fixes golang#10135. Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e Signed-off-by: Shenghou Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/7400 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/14248 Reviewed-by: Andrew Gerrand <[email protected]>
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 9, 2018
… non-zero len from growslice Fixes golang#10135. Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e Signed-off-by: Shenghou Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/7400 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/14248 Reviewed-by: Andrew Gerrand <[email protected]>
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 20, 2018
… non-zero len from growslice Fixes golang#10135. Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e Signed-off-by: Shenghou Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/7400 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/14248 Reviewed-by: Andrew Gerrand <[email protected]>
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 30, 2018
… non-zero len from growslice Fixes golang#10135. Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e Signed-off-by: Shenghou Ma <[email protected]> Reviewed-on: https://go-review.googlesource.com/7400 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/14248 Reviewed-by: Andrew Gerrand <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I ran into the following runtime error while attempting access an empty struct value that had been appended to an uninitialised slice: https://play.golang.org/p/J2ItiISh2f,
The append (line 11) succeeds, as does printing the slice as a whole (line 12); accessing the appended struct via range (line 16) yields a panic. Issue encountered under 1.4.1; unable to replicate under gccgo.
Known workaround: comment out line 8 in favour of 9 and make an empty slice explicitly (yuck).
The following also work as expected, though they alter intended behaviour:
The text was updated successfully, but these errors were encountered: