Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 23 Jun 2020 13:43:12 +0200
From: Michal Nowak <mnowak@....org>
To: musl@...ts.openwall.com
Subject: Better backtrace from core dump

Hi,

in GitLab we have jobs which run BIND system tests on different 
operating system, mostly in Docker on Debian 10 but too in KVM virtual 
machines for non-Linux operating systems. If the test produces core 
dump, we generate backtrace out of it while still in the CI.

For all C libraries but for musl we get reasonable backtraces, e.g. 
https://gitlab.isc.org/isc-projects/bind9/-/jobs/970585, but for Alpine 
Linux 3.11 (musl 1.1.24-r2 & GCC 9.2.0-r4) we get something like this 
(https://gitlab.isc.org/isc-projects/bind9/-/jobs/970568):

warning: Can't read pathname for load map: No error information.
Core was generated by 
`/builds/isc-projects/bind9/bin/named/.libs/lt-named -D statistics-ns3 
-X named.'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007fb708ec39ee in setjmp () from /lib/ld-musl-x86_64.so.1
[Current thread is 1 (LWP 1274)]
#0  0x00007fb708ec39ee in setjmp () from /lib/ld-musl-x86_64.so.1
#1  0x00007fb708ec3b49 in raise () from /lib/ld-musl-x86_64.so.1
#2  0x804ad6685d596f46 in ?? ()
#3  0x00007fb708bd1030 in ns_modules () from 
/builds/isc-projects/bind9/lib/ns/.libs/libns.so.1702
#4  0x00007fb708e59edf in ?? () from 
/builds/isc-projects/bind9/lib/isc/.libs/libisc.so.1702
#5  0x0000000042756621 in ?? ()
#6  0x00007fb7069c9db0 in ?? ()
#7  0x0000001800000018 in ?? ()
#8  0x00007fb708f0e873 in ?? () from /lib/ld-musl-x86_64.so.1
#9  0x0000000000000008 in ?? ()
#10 0x00007fb7069ca0e8 in ?? ()
#11 0x00007fb7069ca0d0 in ?? ()
#12 0x00007fb708e32d12 in isc_hash_function (data=0x459, length=0, 
case_sensitive=<optimized out>) at hash.c:117

This is how we generate the backtrace:

   "${top_builddir}/libtool" --mode=execute gdb --batch 
--command=run.gdb --core="$coredump" -- "$binary"

The GDB command can be either 'bt' or 'thread apply all bt full' (for 
more on the GDB invocation, see 
https://gitlab.isc.org/isc-projects/bind9/-/blob/main/bin/tests/system/run.sh.in#L268).

CFLAGS used:

   -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1 -g -Wall -Wextra

This is what we install on top of the stock Alpine Linux 3.11 Docker 
image: 
https://gitlab.isc.org/isc-projects/images/-/blob/main/docker/bind9/alpine-template/Dockerfile. 
Are there other packages, we should get into the image to get better 
backtraces?

Should we use something else than GDB?

Should we add some compiler flags?

Thanks,
Michal

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.