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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16292 invoked from network); 11 Jan 2024 17:03:36 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 11 Jan 2024 17:03:36 -0000 Received: (qmail 9972 invoked by uid 550); 11 Jan 2024 17:01:59 -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 9937 invoked from network); 11 Jan 2024 17:01:58 -0000 Date: Thu, 11 Jan 2024 18:03:23 +0100 From: Szabolcs Nagy To: Cody Wetzel Cc: Natanael Copa , musl@lists.openwall.com, Markus Wichmann Message-ID: <20240111170323.GP1427497@port70.net> Mail-Followup-To: Cody Wetzel , Natanael Copa , musl@lists.openwall.com, Markus Wichmann References: <20231221222513.799557a1@ncopa-desktop.lan> <20240104144811.GO1427497@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Subject: Re: [musl] Segmentation fault musl 1.2.4 * Cody Wetzel [2024-01-10 09:59:18 -0600]: > So maybe I'm not understanding how gdb works or is used. you have to run the process.. you never issued the gdb 'run' command. > I'm getting no > meaningful output even though these commands should result in a > segmentation fault. >=20 > > / # gdb > > Segmentation fault > > / # /tmp/ld-musl-armhf.so.1 /usr/bin/gdb --args ls -l /tmp > > GNU gdb (GDB) 12.1 > > Copyright (C) 2022 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later < > > http://gnu.org/licenses/gpl.html> > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > Type "show copying" and "show warranty" for details. > > This GDB was configured as "armv7-alpine-linux-musleabihf". > > Type "show configuration" for configuration details. > > For bug reporting instructions, please see: > > . > > Find the GDB manual and other documentation resources online at: > > . > > For help, type "help". > > Type "apropos word" to search for commands related to "word"... > > Reading symbols from ls... > > (No debugging symbols found in ls) > > (gdb) > > quit > > / # /tmp/ld-musl-armhf.so.1 /usr/bin/gdb --args cd /tmp > > GNU gdb (GDB) 12.1 > > Copyright (C) 2022 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later < > > http://gnu.org/licenses/gpl.html> > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > Type "show copying" and "show warranty" for details. > > This GDB was configured as "armv7-alpine-linux-musleabihf". > > Type "show configuration" for configuration details. > > For bug reporting instructions, please see: > > . > > Find the GDB manual and other documentation resources online at: > > . > > For help, type "help". > > Type "apropos word" to search for commands related to "word"... > > cd: No such file or directory. > > (gdb) > > quit > > / # /tmp/ld-musl-armhf.so.1 /usr/bin/gdb --args apk -h /tmp > > GNU gdb (GDB) 12.1 > > Copyright (C) 2022 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later < > > http://gnu.org/licenses/gpl.html> > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > Type "show copying" and "show warranty" for details. > > This GDB was configured as "armv7-alpine-linux-musleabihf". > > Type "show configuration" for configuration details. > > For bug reporting instructions, please see: > > . > > Find the GDB manual and other documentation resources online at: > > . > > For help, type "help". > > Type "apropos word" to search for commands related to "word"... > > Reading symbols from apk... > > (No debugging symbols found in apk) > > (gdb) bt > > No stack. > > (gdb) disas $pc-40,+80 > > No registers. > > (gdb) info reg > > The program has no registers now. >=20 >=20 > On Thu, Jan 4, 2024 at 8:48=E2=80=AFAM Szabolcs Nagy wro= te: >=20 > > * Cody Wetzel [2024-01-03 11:20:29 -0600]: > > > Hello musl team, > > > > > > I tried getting a core dump but I'm not sure if I'm doing something > > wrong... > > > > > > / # cat /proc/sys/kernel/core_pattern/tmp/core-%e-%s-%u-%g-%p-%t/ # > > > apk upgrade busybox > > > --repository=3Dhttps://dl-cdn.alpinelinux.org/alpine/v3.18/main > > > --repository=3Dhttps://dl-cdn.alpinelinux.org/alpine/v3.18/communityf= etch > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.ta= r.gzfetch > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gzf= etch > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.17/main/armv7/APKINDEX.tar.gzf= etch > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.17/community/armv7/APKINDEX.ta= r.gz(1/3) > > > Upgrading busybox (1.35.0-r29 -> 1.36.1-r5)Executing > > > busybox-1.36.1-r5.post-upgrade(2/3) Upgrading busybox-binsh > > > (1.35.0-r29 -> 1.36.1-r5)(3/3) Upgrading ssl_client (1.35.0-r29 -> > > > 1.36.1-r5)Executing busybox-1.36.1-r5.triggerOK: 5 MiB in 15 packages/ > > > # apk upgrade musl > > > --repository=3Dhttps://dl-cdn.alpinelinux.org/alpine/v3.18/main > > > --repository=3Dhttps://dl-cdn.alpinelinux.org/alpine/v3.18/community(= 1/1) > > > Upgrading musl (1.2.3-r5 -> 1.2.4-r2)OK: 5 MiB in 15 packages/ # apk > > > upgrade rust --repository=3D > > https://dl-cdn.alpinelinux.org/alpine/v3.18/main > > > --repository=3D > > https://dl-cdn.alpinelinux.org/alpine/v3.18/communitySegmentation > > > fault/ # apk -hSegmentation fault/ # ls /tmp/core*Segmentation fault/ > > > # cd /tmp/tmp # lsSegmentation fault > > > > i'd > > > > # cp /lib/ld-musl-armhf.so.1 /tmp > > # apk add gdb musl-dbg apk-tools-static > > > > then upgrade musl using apk.static, then debug via > > > > # /tmp/ld-musl-armhf.so.1 /usr/bin/gdb --args ls -l /tmp > > > > or analyze a core dump, you can always install more debug tools > > via apk.static and run commands using the old ld-musl-armhf.so.1 > > > > in gdb, you want to do > > > > bt > > disas $pc-40,+80 > > info reg > > info proc map > > > > as a starting point and post the results. > > > > strace output can be useful too as well as readelf -aW of ld.so > > depending on what is going on. > > >=20 >=20 > --=20 > Cody Wetzel > codyawetzel@gmail.com > (402)490-9242