cmd/link: problem with asan in combination with -X #56175
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
Unpack the attached tar file, then run "trystringmain.sh".
The Go program in the zip file contains two packages, "main" and "p". If you cd to "main" and run normally, works fine, e.g.
However if you use "trystringmain.sh", it links the program with a series of "-X" options, the resulting program gets an asan error at runtime.
What did you expect to see?
Clean run with output of each string.
What did you see instead?
An asan error on the first string reference. Transcript:
What seems to be happening here is that at the point where the globals are compiled, the compiler is recording their sizes, however the linker is overriding the size due to the -X.
@thanm @lfolger @cherrymui
asanexample.zip
The text was updated successfully, but these errors were encountered: