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.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,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 11864 invoked from network); 11 Jan 2024 18:19:45 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 11 Jan 2024 18:19:45 -0000 Received: (qmail 24283 invoked by uid 550); 11 Jan 2024 18:18:07 -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 24250 invoked from network); 11 Jan 2024 18:18:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704997171; x=1705601971; darn=lists.openwall.com; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=WqNfVrMIwkuGH1r80y84mbDot2odVAqLqr2FRs2ZhBI=; b=E8LcdKxYvuAkxgY7riQv0r7aQWGd2C859e7/Ztfy3Qk8JjM2h4E9OMAmA6tWCC6r1Y b5x8l5uf6tubFoSNZbRNLcsTs4cWu+wjWgldKxKB+Em/WgN72cFfse4dzVZbQ1A8UI9Z e9piHx5soiX3AdMJvjuJ93GEgk9FH4rxv6c5ReQuTkugv5mX5QwFaYzDMMI3u8UGi5Pr 0973JGFY8aiIyIifi0iVLTs0MuwOW3zt4mCKEvrkOzbDsicKAt2fFMgK1cK7cQscvJ+L O9ESikO6+kl6GtmOMPNP/5/cd75bZtGyrIFo7GEr7mkBHpOoFeU9gBAKwGYr5pG4hUab I1Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704997171; x=1705601971; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WqNfVrMIwkuGH1r80y84mbDot2odVAqLqr2FRs2ZhBI=; b=GqhHBWN/aMvPeLes5pDP9Yoq+8/VCrgtZJsv1B7mjzdI/r6StSDPwaAW/B562Tm9hf pGBXe2LsphlBfB3te7fESCbQFmKAuU9Q3bEq1aFkWFl8whoxHJFL6d10rRWcuZZ78FFl 5aqjYeY2+rsdwWdOcZDDOm3TD7OiPhXUeErIbcdhN6fsTPWdZ7UL8t5kczr9u0WrrRDP UWkVSpqpSOM6bHnAUza2Y85Mjo8twSPs4wSlctsEqhU9tyWgLxayv/6w8wLV3IsxgEf7 CPyQZmrah/SE0juXEnRI0zB4mvZPW+iue0aEm22DJUy1I3sp+z8dE+1Co0RJwBe932zS B9hA== X-Gm-Message-State: AOJu0YwPxP74NcJjXXGXm3R8zyMSe9vEw7a6iTxhyHvzkDQGXVQl3PVV caGCEGKeZLwe5ykQ/9ljspUGVbBCLF72rZdT6tk= X-Google-Smtp-Source: AGHT+IEhSM38pKJzLL+VnjcRZ+HxLbBl8oKaglET1I3q5f9IoZrp3w/YbvRTlERjyFYlACZ2KB5YMzeNqrSoMtlr2HA= X-Received: by 2002:a81:4502:0:b0:5f9:9457:e5aa with SMTP id s2-20020a814502000000b005f99457e5aamr190774ywa.68.1704997171102; Thu, 11 Jan 2024 10:19:31 -0800 (PST) MIME-Version: 1.0 References: <20231221222513.799557a1@ncopa-desktop.lan> <20240104144811.GO1427497@port70.net> <20240111170323.GP1427497@port70.net> In-Reply-To: <20240111170323.GP1427497@port70.net> From: Cody Wetzel Date: Thu, 11 Jan 2024 12:19:16 -0600 Message-ID: To: Cody Wetzel , Natanael Copa , musl@lists.openwall.com, Markus Wichmann Content-Type: multipart/alternative; boundary="000000000000ba0835060eaf96bd" Subject: Re: [musl] Segmentation fault musl 1.2.4 --000000000000ba0835060eaf96bd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, I'm definitely not that well versed in linux. I received the following... / # /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) run > Starting program: /bin/ls -l /tmp > warning: Error disabling address space randomization: Operation not > permitted > warning: Could not trace the inferior process. > warning: ptrace: Operation not permitted > warning: Error restoring address space randomization: Operation not > permitted > During startup program exited with code 127. > Thanks! On Thu, Jan 11, 2024 at 11:03=E2=80=AFAM Szabolcs Nagy wro= te: > * 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. > > > > > / # 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. > > > > > > On Thu, Jan 4, 2024 at 8:48=E2=80=AFAM Szabolcs Nagy w= rote: > > > > > * 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=3D > https://dl-cdn.alpinelinux.org/alpine/v3.18/communityfetch > > > > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.tar.= gzfetch > > > > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gzfet= ch > > > > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.17/main/armv7/APKINDEX.tar.gzfet= ch > > > > > > > > https://dl-cdn.alpinelinux.org/alpine/v3.17/community/armv7/APKINDEX.tar.= 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=3D > https://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/ # ap= k > > > > 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 faul= t/ > > > > # 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. > > > > > > > > > -- > > Cody Wetzel > > codyawetzel@gmail.com > > (402)490-9242 > --=20 Cody Wetzel codyawetzel@gmail.com (402)490-9242 --000000000000ba0835060eaf96bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, I'm definitely=C2=A0not that well versed in lin= ux.=C2=A0 I received=C2=A0the following...

/ # /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&= gt;
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 co= nfigured as "armv7-alpine-linux-musleabihf".
Type "show c= onfiguration" for configuration details.
For bug reporting instruct= ions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and= other documentation resources online at:
=C2=A0 =C2=A0 <http://www.gnu.org/software/= gdb/documentation/>.

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) run
Starting program: /bin/ls -l /tmp
warning: Error disabling= address space randomization: Operation not permitted
warning: Could not= trace the inferior process.
warning: ptrace: Operation not permittedwarning: Error restoring address space randomization: Operation not permit= ted
During startup program exited with code 127.
Thanks!=C2=A0=C2=A0

=
On Thu, Jan 11, 2024 at 11:03=E2=80= =AFAM Szabolcs Nagy <nsz@port70.net> wrote:
* C= ody Wetzel <c= odyawetzel@gmail.com> [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.
>
> > / # 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 d= etails.
> > This GDB was configured as "armv7-alpine-linux-musleabihf&qu= ot;.
> > Type "show configuration" for configuration details. > > For bug reporting instructions, please see:
> > <https://www.gnu.org/software/gdb/bugs/>.<= br> > > Find the GDB manual and other documentation resources online at:<= br> > > <http://www.gnu.org/software/gdb/document= ation/>.
> > For help, type "help".
> > Type "apropos word" to search for commands related to &= quot;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 d= etails.
> > This GDB was configured as "armv7-alpine-linux-musleabihf&qu= ot;.
> > Type "show configuration" for configuration details. > > For bug reporting instructions, please see:
> > <https://www.gnu.org/software/gdb/bugs/>.<= br> > > Find the GDB manual and other documentation resources online at:<= br> > > <http://www.gnu.org/software/gdb/document= ation/>.
> > For help, type "help".
> > Type "apropos word" to search for commands related to &= quot;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 d= etails.
> > This GDB was configured as "armv7-alpine-linux-musleabihf&qu= ot;.
> > Type "show configuration" for configuration details. > > For bug reporting instructions, please see:
> > <https://www.gnu.org/software/gdb/bugs/>.<= br> > > Find the GDB manual and other documentation resources online at:<= br> > > <http://www.gnu.org/software/gdb/document= ation/>.
> > For help, type "help".
> > Type "apropos word" to search for commands related to &= quot;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.
>
>
> On Thu, Jan 4, 2024 at 8:48=E2=80=AFAM Szabolcs Nagy <nsz@port70.net> wrote:
>
> > * Cody Wetzel <codyawetzel@gmail.com> [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.alpinel= inux.org/alpine/v3.18/main
> > > --repository=3Dhttps://dl-c= dn.alpinelinux.org/alpine/v3.18/communityfetch
> > >
> > https://dl= -cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.tar.gzfetch<= br> > > >
> > https://dl-cdn.= alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gzfetch
> > >
> > https://dl-cdn.= alpinelinux.org/alpine/v3.17/main/armv7/APKINDEX.tar.gzfetch
> > >
> > https://dl= -cdn.alpinelinux.org/alpine/v3.17/community/armv7/APKINDEX.tar.gz(1/3)<= br> > > > Upgrading busybox (1.35.0-r29 -> 1.36.1-r5)Executing
> > > busybox-1.36.1-r5.post-upgrade(2/3) Upgrading busybox-binsh<= br> > > > (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.alpinel= inux.org/alpine/v3.18/main
> > > --repository=3Dhttps://dl-c= dn.alpinelinux.org/alpine/v3.18/community(1/1)
> > > Upgrading musl (1.2.3-r5 -> 1.2.4-r2)OK: 5 MiB in 15 pack= ages/ # apk
> > > upgrade rust --repository=3D
> > https://dl-cdn.alpinelinux.org/alpine/v3.= 18/main
> > > --repository=3D
> > https://dl-cdn.alpinelinu= x.org/alpine/v3.18/communitySegmentation
> > > fault/ # apk -hSegmentation fault/ # ls /tmp/core*Segmentati= on 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<= br> > >
> > 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.
> >
>
>
> --
> Cody Wetzel
> codyawetzel= @gmail.com
> (402)490-9242


--
Co= dy Wetzel
cod= yawetzel@gmail.com
(402)490-9242
--000000000000ba0835060eaf96bd--