-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: &(*input) causes segfault #71056
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
Comments
I m wondering if i uncovered a compiler bug of if i'm missing something about pointers dereferencing |
I can't reproduce the crash. *it is equivalent to Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
I can reproduce it ~90% of the time (did you make sure to switch my sample code into "broken mode" ?) I'm wondering, how is
|
Looking at the non-optimized output I see that there is a substantial different is what is done (e.g. the call to For the statement
While the program successfully runs when
|
I've tried running both, I'm on
In go the |
Change https://go.dev/cl/638856 mentions this issue: |
Thanks for your explanation. |
I am as puzzled as you are. It's not a no-op because it'll panic if passed a nil pointer but I doubt this is what all of the results in your codesearch intended. |
Change https://go.dev/cl/639195 mentions this issue: |
Can you please try with go1.24.0-rc1 release ? CI succeeded when tested on today's master. |
Right, so its not just me :) As long as I ve been doing go, this read to me as Will test on 1.24 shortly |
fwiw I'm able to reproduce this on Mac M1 with 1.23.3, tip to follow in a second:
With tip 2b794ed:
|
Here is a linux/arm64 build https://go-review.googlesource.com/c/go/+/638856?attempt=1&checksRunsSelected=gotip-linux-arm64&tab=checks because TIL the default runners doesn't include darwin arm64. |
@Jorropo can I somehow run tip's test suite locally after I've installed tip? |
git fetch https://go.googlesource.com/go refs/changes/56/638856/2 && git checkout -b change-638856 FETCH_HEAD
cd src && ./all.bash |
I got it to happen once on linux/amd64 (on the first go run on |
But it appears that CI indeed failed on darwin https://ci.chromium.org/ui/p/golang/builders/try/gotip-darwin-arm64_11/b8727211259355526545/overview |
Now that's a bit surprising: `./all.bash` logs
|
Running sample program with race detector: gotip run -race test.go
WARNING: DATA RACE |
Is this just invalid due to the race in |
Thx for that, I somehow red |
And that explains why it does not work exclusively with the buggy |
it does fail on 1.24:
|
So the bottom line is that there is this urban legend going around that |
The clone never happens this leads to a datarace when doing The datarace is the crash, and it dataraces because as you pointed out there is urban legend that |
Hum, very interesting, learnt something new today, thanks for the quick turnaround! |
just so you know next time you should ask on one of the things listed on https://go.dev/wiki/Questions |
Note that staticcheck reports this as SA4001:
which corresponds to these lines:
|
Go version
go version go1.23.4 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
&(*input)
caused segfault onp.Children[i].Toy = &(*child.Toy)
What did you expect to see?
*input
and separate&
doesntThe text was updated successfully, but these errors were encountered: