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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 22864 invoked from network); 24 Sep 2021 13:51:49 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 24 Sep 2021 13:51:49 -0000 Received: (qmail 3264 invoked by uid 550); 24 Sep 2021 13:51:48 -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 3246 invoked from network); 24 Sep 2021 13:51:47 -0000 X-Virus-Scanned: SPAM Filter at disroot.org Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1632491495; bh=u0Q+UoXm5eJl33dxVyCPaa9blC6Jc7DnKXD56EraIAM=; h=Subject:From:To:Date; b=bn5KopeAV5sMKvmLuwIC4IAZX0F1vHeRuLgjhJkBOw9sv2/6lFLPDh6zLRrUQnaqF azoaTrfSC1p+MBCziDz2oAkfy9ZKC5yu5c89EOcCWa06yCeGLIkXWXLNFkxB00rLjU zFCr4aKQtrIHL6Aubxk9JBHGwJ+oJvSoRN7TKtE2Og7D3Ggzfsr1ckZCH6PGvRV7HR Od+reoSGy4HTXzUrrjn/WMvnaTjAJgjOjiZ8HY4zupAilcoOq/9disFGfR7QzMxrhG z8XUh4DfIFwn5uuwe0BEUrYgtXjxMhx4nppX85PhC5Om4wInbdMTZUhFiX39zBOt5c CPbncOMh7hx5Q== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 From: =?utf-8?q?=C3=89rico_Nogueira?= To: , "Rich Felker" Date: Fri, 24 Sep 2021 10:48:57 -0300 Message-Id: Subject: Re: [musl] Musl compiled gawk coredumps. How to find out where? On Fri Sep 24, 2021 at 10:02 AM -03, Ivo Palli wrote: > That helped! > > (gdb) backtrace > #0 __restore_sigs (set=3Dset@entry=3D0x7fff62ee5de0) at > ./arch/x86_64/syscall_arch.h:40 > #1 0x00000000004cf1c4 in raise (sig=3Dsig@entry=3D6) at > src/signal/raise.c:11 > #2 0x00000000004c96ea in abort () at src/exit/abort.c:11 > #3 0x0000000000452f16 in catchsig (sig=3D) at main.c:1231 > #4 catchsig (sig=3D) at main.c:1217 > #5 > #6 get_meta (p=3Dp@entry=3D0x7f4d35d74f50 "\260\232\243\001") at > src/malloc/mallocng/meta.h:141 > #7 0x00000000004ca62c in __libc_free (p=3D0x7f4d35d74f50) at > src/malloc/mallocng/free.c:105 > #8 0x0000000000459d57 in r_unref (tmp=3Dtmp@entry=3D0x7f4d35f5c778) at > node.c:492 > #9 0x00000000004456e5 in unref (r=3D0x7f4d35f5c778) at awk.h:1898 > #10 purge_record () at field.c:360 > #11 0x0000000000445f36 in set_record ( > buf=3D0x7f4d34f34cfe > "SIZE\t1KB\t192758\t112698119\nSIZE\t4KB\t462090\t1122421206\nSIZE\t16KB\= t355596\t3138948391\nSIZE\t64KB\t413028\t13558910172\nSIZE\t256KB\t1014012\= t165385758947\nSIZE\t1MB\t2546508\t1346405498466\nSIZE\t10MB\t480844\t16027= 96961"..., > cnt=3D25, fw=3D0x0) at field.c:269 > #12 0x000000000044e765 in inrec (iop=3D, > errcode=3Derrcode@entry=3D0x7fff62ee6cb0) at io.c:608 > #13 0x00000000004414f8 in h_interpret (code=3D) at > interpret.h:1289 > #14 0x0000000000402631 in main (argc=3D, argv=3D out>) at main.c:516 > > Little unsure where gawk stops and musl begins. I guess #6 is where it > goes wrong. Any musl developer want to work with me to figure this out? You are correct that #6 is where it starts, above that it's just the SIGSEGV signal handler. Do you think you can share your script and input? That would help anyone trying to reproduce the bug if they can't find the issue in the code via inspection. > > Ivo Palli > > ________________________________ > From: Rich Felker > Sent: Friday, September 24, 2021 14:37 > To: Ivo Palli > Cc: musl@lists.openwall.com > Subject: Re: [musl] Musl compiled gawk coredumps. How to find out where? > > On Fri, Sep 24, 2021 at 10:41:24AM +0000, Ivo Palli wrote: > > Hi there, > > > > I compiled gawk-4.2.1 (with gmp-6.2.1 and mpfr-4.1.0) using musl-1.2.2. > > > > Using it with I script I wrote I get > > > > gawk: /.../.../build_total.awk:25: (FILENAME=3Dbig.report FNR=3D6) fata= l error: internal error > > ../go: line 36: 14488 Aborted (core dumped) > > > > Loading it into gdb doesn't give much information: > > > > # gdb -q ./gawk core.gawk.0.51bcaa32ed144d2498e3a70ff28af961.14488.1632= 479605000000 > > Reading symbols from ./gawk...done. > > [New LWP 14488] > > Core was generated by `gawk -i functions.awk -v TEMPLATE=3D... > > Program terminated with signal SIGABRT, Aborted. > > #0 0x00000000004cf169 in __restore_sigs () > > (gdb) backtrace > > #0 0x00000000004cf169 in __restore_sigs () > > #1 0x00000000004cf1c4 in raise () > > #2 0x0000000000000000 in ?? () > > (gdb) frame 0 > > #0 0x00000000004cf169 in __restore_sigs () > > (gdb) print > > The history is empty. > > (gdb) > > > > I compiled gawk the same with regular gcc (version 8.3.1 20190507 (Red = Hat 8.3.1-4)) into a dynamic binary with the same libraries, and that did c= omplete my script without crashing. > > > > Can anybody inform me how to find out exactly where the crash occurs an= d how I can help fix this bug? > > Try with musl and gawk built with debug info. If you're running with > musl provided by your distro, it probably has a debug symbols package > you can install. If you're building musl yourself, add --enable-debug > to configure command line or -g to CFLAGS manually. > > Rich