-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: intermittently produces segfaulting executables with binutils 2.27-44 #51611
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
Is this specifically a 1.17.8 thing? Or you can reproduce this with other releases? |
This comment was marked as off-topic.
This comment was marked as off-topic.
I was also able to reproduce it on 1.17. |
Updated case info with reason for building go from source. |
Do the test programs that you are building have C dependencies? What happens if you build with |
They do not have C dependencies. |
@bcmills I still encountered the seg fault with both
So I would not think that CGO_ENABLED or linkmode=internal should affect it. |
Is there anything else you need from me? |
Are there any differences in the actual commands used to build the executables? (What differences, if any, do you see if you run |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?We build go from source ourselves using this Makefile:
The reason for building go ourselves is that from go 1.16 our version of binutils no longer worked with the pre-compiled go release. We encountered the problem described here #43996
Our version of binutils:
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I built 1000 'empty' go executables with:
@go build -o ./bin -compiler=gc ./vt/tools/dummies/...
The only code in these programs is:
All of the programs are in the ./vt/tools/dummies folder and are named dummy0 ... dummy999.
After compiling them successfully 148 times, on the 149th compilation on of the binaries cannot be executed and segfaults:
The
go build
command itself exits cleanly.What did you expect to see?
go build
to produce valid executables, and if it doesn't, it should fail.What did you see instead?
go build
exits cleanly but produced an executable that segfaults.I compared the segfaulting binary to a valid binary in Ghidra. The segfaulting one is on the left (dummy191.sf)
The text was updated successfully, but these errors were encountered: