Skip to content

cmd/cgo/internal/testsanitizers: ASAN symbolization problems for LUCI's older gcc versionswith DWARF 5 #72752

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

Open
thanm opened this issue Mar 9, 2025 · 2 comments
Assignees
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@thanm
Copy link
Contributor

thanm commented Mar 9, 2025

In the LUCI infrastucture used for Golang testing, we use system images that have baked-in versions of GCC. At the moment for linux-amd64 this means version 10 of GCC, including corresponding versions of various runtime libraries needed to support GCC (e.g. libcc.a, libgcc_s.so, and so on).

In the process of migrating the Go compiler+linker to generate DWARF version 5, we discovered that the asan tests in cmd/cgo/internal/testsanitizers were failing on linux/amd64 LUCI builders with symbolization problems. Here is an example failure:

    asan_test.go:74: `/home/swarming/.swarming/w/ir/x/t/TestASANasan_unsafe_fail3190432212/001/asan_unsafe_fail3` exited without expected location of the error
        asan_unsafe_fail3.go:18; got failure
        =================================================================
        ==40747==ERROR: AddressSanitizer: use-after-poison on address 0x10c000122068 at pc 0x00000053df85 bp 0x000000000000 sp 0x10c000070ef8
        WRITE of size 8 at 0x10c000122068 thread T0
            #0 0x53df84 in fmt.Println <autogenerated>:18
            #1 0x53df84 in main.main <autogenerated>:20
            #2 0x46ebec in asancall ?:89

Asan is correctly reporting a problem, but getting the file/line wrong when DWARF 5 is used (DWARF 4 has no such issue). Later versions of the runtime (e.g. libasan.so.8 as opposed to libasan.so.6) don't seem to have this problem.

Filing this issue to describe the prolem, and to make a note of the fact that it would be nice to get the GCC version baked into our LUCI images updated to something more modern (GCC 10 is a 2020-vintage release that is no longer supported/updated).

@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 9, 2025
@thanm thanm added this to the Backlog milestone Mar 9, 2025
@thanm thanm self-assigned this Mar 9, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/656175 mentions this issue: cmd/cgo/internal/testsanitizers: bump GCC version for asan location checking

@gabyhelp
Copy link

gabyhelp commented Mar 9, 2025

@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Mar 9, 2025
gopherbot pushed a commit that referenced this issue Mar 10, 2025
…hecking

Require GCC 11 or greater to turn on the location checking portion of
the asan tests in this directory; the copy of libasan.so.6 shipped
with GCC 10 doesn't seem to properly digest the new DWARF 5 being
generated by the Go compiler+linker.

Updates #72752.

Change-Id: I92718c112df844d9333c4c798cddaae95665feb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/656175
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants