-
Notifications
You must be signed in to change notification settings - Fork 18k
cgo: malformed DWARF TagVariable entry [1.18 backport] #57044
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
^^ to add some context We started running into this issue after the official docker golang alpine image updated to alpine 3.17, which comes with a newer version of clang (see moby/moby#44570); With alpine 3.16: docker run -it --rm golang:1.18.8-alpine3.16 sh -c 'apk add --quiet --no-cache clang && clang --version'
Alpine clang version 13.0.1
Target: aarch64-alpine-linux-musl
Thread model: posix
InstalledDir: /usr/bin With alpine 3.17: docker run -it --rm golang:1.18.8-alpine3.17 sh -c 'apk add --quiet --no-cache clang && clang --version'
Alpine clang version 15.0.6
Target: aarch64-alpine-linux-musl
Thread model: posix
InstalledDir: /usr/bin If you have docker installed, the issue can be reproduced with this Dockerfile; ARG ALPINE_VERSION
FROM golang:1.18.8-alpine${ALPINE_VERSION} AS golatest
RUN apk add --no-cache clang lld git musl-dev gcc
WORKDIR /containerd
RUN set -ex \
&& git clone https://github.com/containerd/containerd.git . \
&& git fetch origin \
&& git checkout -q v1.5.11 \
&& CGO_ENABLED=1 CC=clang go build -tags no_btrfs ./cmd/containerd With alpine 3.16 (clang 13), it passes; docker build -t example --build-arg ALPINE_VERSION=3.16 .
... And with alpine 3.17 (clang 15), it fails: docker build -t example --build-arg ALPINE_VERSION=3.17 .
...
> [4/4] RUN set -ex && git clone https://github.com/containerd/containerd.git . && git fetch origin && git checkout -q v1.5.11 && CGO_ENABLED=1 CC=clang go build -tags no_btrfs ./cmd/containerd:
#8 0.261 + git clone https://github.com/containerd/containerd.git .
#8 0.271 Cloning into '.'...
#8 15.91 + git fetch origin
#8 16.44 + git checkout -q v1.5.11
#8 17.02 + CGO_ENABLED=1 CC=clang go build -tags no_btrfs ./cmd/containerd
#8 28.33 # github.com/miekg/pkcs11
#8 28.33 cgo: malformed DWARF TagVariable entry
------
process "/bin/sh -c set -ex && git clone https://github.com/containerd/containerd.git . && git fetch origin && git checkout -q v1.5.11 && CGO_ENABLED=1 CC=clang go build -tags no_btrfs ./cmd/containerd" did not complete successfully: exit code: 2 We noticed that #53013 (https://go.dev/cl/454415 ) was accepted to be backported, which seems related, so we would like to request https://go.dev/cl/406816 to be backported as well. |
This seems fine to me. |
https://reviews.llvm.org/D123534 is emitting DW_TAG_variable's that don't have a DW_AT_name. This is allowed in the DWARF standard. It is adding DIE's for string literals for better symbolization on buffer overlows etc on these strings. They no associated name because they are not user provided variables. Fixes golang#57044 Updates golang#53000 Change-Id: I2cf063160508687067c7672cef0517bccd707d7b Reviewed-on: https://go-review.googlesource.com/c/go/+/406816 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> (cherry picked from commit e66f895)
Change https://go.dev/cl/455055 mentions this issue: |
Change https://go.dev/cl/455056 mentions this issue: |
Closed by merging e6adccb to release-branch.go1.18. |
https://reviews.llvm.org/D123534 is emitting DW_TAG_variable's that don't have a DW_AT_name. This is allowed in the DWARF standard. It is adding DIE's for string literals for better symbolization on buffer overlows etc on these strings. They no associated name because they are not user provided variables. Fixes #57044 Updates #53000 Change-Id: I2cf063160508687067c7672cef0517bccd707d7b Reviewed-on: https://go-review.googlesource.com/c/go/+/406816 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> (cherry picked from commit e66f895) Change-Id: I2cf063160508687067c7672cef0517bccd707d7b GitHub-Last-Rev: 32208e4 GitHub-Pull-Request: #57067 Reviewed-on: https://go-review.googlesource.com/c/go/+/455055 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: David Chase <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
@crazy-max requested issue #53000 to be considered for backport to the next 1.18 minor release.
The text was updated successfully, but these errors were encountered: