osmith has uploaded this change for review.

View Change

testenv: add talloc debug symbols for asan crashes

Debian publishes debug symbols for libtalloc through debuginfod, not
through debug packages. Unfortunately Address Sanitizer can't fetch
these debug symbols, so we don't get code lines in crash dumps from it
if the crash happens in libtalloc.

Work around this by fetching the debug symbols with debuginfod-find when
building the container and placing symlinks in the location that address
sanitizer looks in.

Related: OS#6997
Change-Id: I618d9acc83942b40c6cb7b86f29909ea19acea65
---
M _testenv/data/podman/Dockerfile
1 file changed, 15 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/44115/1
diff --git a/_testenv/data/podman/Dockerfile b/_testenv/data/podman/Dockerfile
index c0ff503..1a180d6 100644
--- a/_testenv/data/podman/Dockerfile
+++ b/_testenv/data/podman/Dockerfile
@@ -28,6 +28,7 @@
ccache \
cmake \
cpio \
+ debuginfod \
erlang-dev \
erlang-nox \
flex \
@@ -99,6 +100,20 @@
&& \
apt-get clean

+# Debug symbols for some libraries are only available from debuginfod. These
+# cannot be read during address sanitizer crashes, so fetch them ahead of time
+# and put them in the needed directory structure.
+ENV DEBUGINFOD_URLS="https://debuginfod.debian.net"
+RUN set -x && \
+ debuginfod-find debuginfo /usr/lib/x86_64-linux-gnu/libtalloc.so && \
+ cd /root/.cache/debuginfod_client && \
+ for i in */debuginfo; do \
+ first="$(echo "$i" | cut -c-2)" && \
+ rest="$(echo "$i" | cut -c3-40)" && \
+ mkdir -p /usr/lib/debug/.build-id/"$first" && \
+ ln -s "$PWD"/"$i" /usr/lib/debug/.build-id/"$first"/"$rest".debug; \
+ done
+
# Install newer libcurl4 from bookworm-backports, libcurl4 7.88.1-10+deb12u12
# shipped with debian12 is buggy and generates wrong HTTP2 for open5gs.
ENV BACKPORTS_SOURCES_LIST="/etc/apt/sources.list.d/debian-backports.sources"

To view, visit change 44115. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I618d9acc83942b40c6cb7b86f29909ea19acea65
Gerrit-Change-Number: 44115
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>