From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7236 invoked from network); 23 Jun 2020 13:03:36 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 23 Jun 2020 13:03:36 -0000 Received: (qmail 30040 invoked by uid 550); 23 Jun 2020 13:03:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30022 invoked from network); 23 Jun 2020 13:03:27 -0000 To: musl@lists.openwall.com References: From: Michal Nowak Organization: ISC Message-ID: Date: Tue, 23 Jun 2020 15:03:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] Better backtrace from core dump Thanks Timo, this worked for me. Michal On 23/06/2020 14:12, Timo Ter=C3=A4s wrote: > Hi >=20 > Install musl-dbg package to get the debug symbols. >=20 > Timo >=20 > On Tue, 23 Jun 2020, 14.43 Michal Nowak, > wrote: >=20 > Hi, >=20 > in GitLab we have jobs which run BIND system tests on different > operating system, mostly in Docker on Debian 10 but too in KVM virt= ual > machines for non-Linux operating systems. If the test produces core > dump, we generate backtrace out of it while still in the CI. >=20 > For all C libraries but for musl we get reasonable backtraces, e.g. > https://gitlab.isc.org/isc-projects/bind9/-/jobs/970585, but for Al= pine > Linux 3.11 (musl 1.1.24-r2 & GCC 9.2.0-r4) we get something like th= is > (https://gitlab.isc.org/isc-projects/bind9/-/jobs/970568): >=20 > 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=C2=A0 0x00007fb708ec39ee in setjmp () from /lib/ld-musl-x86_64.s= o.1 > [Current thread is 1 (LWP 1274)] > #0=C2=A0 0x00007fb708ec39ee in setjmp () from /lib/ld-musl-x86_64.s= o.1 > #1=C2=A0 0x00007fb708ec3b49 in raise () from /lib/ld-musl-x86_64.so= .1 > #2=C2=A0 0x804ad6685d596f46 in ?? () > #3=C2=A0 0x00007fb708bd1030 in ns_modules () from > /builds/isc-projects/bind9/lib/ns/.libs/libns.so.1702 > #4=C2=A0 0x00007fb708e59edf in ?? () from > /builds/isc-projects/bind9/lib/isc/.libs/libisc.so.1702 > #5=C2=A0 0x0000000042756621 in ?? () > #6=C2=A0 0x00007fb7069c9db0 in ?? () > #7=C2=A0 0x0000001800000018 in ?? () > #8=C2=A0 0x00007fb708f0e873 in ?? () from /lib/ld-musl-x86_64.so.1 > #9=C2=A0 0x0000000000000008 in ?? () > #10 0x00007fb7069ca0e8 in ?? () > #11 0x00007fb7069ca0d0 in ?? () > #12 0x00007fb708e32d12 in isc_hash_function (data=3D0x459, length=3D= 0, > case_sensitive=3D) at hash.c:117 >=20 > This is how we generate the backtrace: >=20 > =C2=A0 =C2=A0"${top_builddir}/libtool" --mode=3Dexecute gdb --batc= h > --command=3Drun.gdb --core=3D"$coredump" -- "$binary" >=20 > The GDB command can be either 'bt' or 'thread apply all bt full' (f= or > more on the GDB invocation, see > https://gitlab.isc.org/isc-projects/bind9/-/blob/main/bin/tests/sys= tem/run.sh.in#L268). >=20 > CFLAGS used: >=20 > =C2=A0 =C2=A0-fno-omit-frame-pointer -fno-optimize-sibling-calls -= O1 -g -Wall > -Wextra >=20 > This is what we install on top of the stock Alpine Linux 3.11 Docke= r > image: > https://gitlab.isc.org/isc-projects/images/-/blob/main/docker/bind9= /alpine-template/Dockerfile. >=20 > Are there other packages, we should get into the image to get bette= r > backtraces? >=20 > Should we use something else than GDB? >=20 > Should we add some compiler flags? >=20 > Thanks, > Michal >=20