-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: using -fuzz with test that links with cgo on darwin causes linker failure #65169
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
Maybe related to #61229 , which fixed very similar crashes when Apple introduced clang version 15 |
Thanks for reporting. I can reproduce the failure. This looks like a bug in Apple's new linker. I'll look into it and report it to Apple. In the mean time, you can work around by using the old Apple linker, by passing the |
The classic linker is not available anymore on MacOS 14.5 |
Change https://go.dev/cl/592095 mentions this issue: |
@gopherbot please backport this to previous releases. This causes build failure when using fuzzing with cgo. (There is a workaround, by specifying the old Apple linker, but that is not great.) |
Backport issue(s) opened: #67944 (for 1.21), #67945 (for 1.22). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/592477 mentions this issue: |
Change https://go.dev/cl/592478 mentions this issue: |
… of data segment Currently the runtime.end symbol is put into the noptrbss section, which is usually the last section, except that when fuzzing is enabled, the last section is actually .go.fuzzcntrs. The runtime.end symbol has the value pointing to the end of the data segment, so if it is not in the last section, the value will not actually be in the range of the section. This causes an assertion failure in the new Apple linker. This CL fixes this by putting it in the last section. Updates #65169. Fixes #67944. Change-Id: I5c991c46a0483a96e5f6e0255a3b444953676026 Reviewed-on: https://go-review.googlesource.com/c/go/+/592095 Reviewed-by: Than McIntosh <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit b589478) Reviewed-on: https://go-review.googlesource.com/c/go/+/592477
… of data segment Currently the runtime.end symbol is put into the noptrbss section, which is usually the last section, except that when fuzzing is enabled, the last section is actually .go.fuzzcntrs. The runtime.end symbol has the value pointing to the end of the data segment, so if it is not in the last section, the value will not actually be in the range of the section. This causes an assertion failure in the new Apple linker. This CL fixes this by putting it in the last section. Updates #65169. Fixes #67945. Change-Id: I5c991c46a0483a96e5f6e0255a3b444953676026 Reviewed-on: https://go-review.googlesource.com/c/go/+/592095 Reviewed-by: Than McIntosh <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit b589478) Reviewed-on: https://go-review.googlesource.com/c/go/+/592478
Go version
go1.21.6, go1.22rc1
Output of
go env
in your module/workspace:What did you do?
Run the following package with
go test . -fuzz=Fuzz
on Mac OS X and it prints a linker failure with both go1.21.6 and go1.22rc1. Usinggo run
orgo test
without fuzzing works fine.cgofuzz.go
cgofuzz_test.go
What did you see happen?
What did you expect to see?
I expected the test to run in fuzzing mode.
The text was updated successfully, but these errors were encountered: