From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9567E3858408; Fri, 6 Jan 2023 15:15:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9567E3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673018141; bh=anwcTfEi0LRvALzKI9RIJFkJLIxiLSrVreHt/urhLUo=; h=From:To:Subject:Date:From; b=mjH0Ruz893BeVp36OccdisxlwlgG6YQOOR7q+UE2BRedNsursP+1WSTKDTJ8zmhU6 shMLcC252G9Rzdlp/mVqpxjQg7fHa8SDdK98QuUBRfvXpnx3jba+VTID8nkXKb3UF2 6CSZilWF3AeOKP59cCxgQdfJWacAPbuozRo62yCA= From: "jhaefliger at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/29969] New: Fail to load file-backed mapping from arm coredump Date: Fri, 06 Jan 2023 15:15:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jhaefliger at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29969 Bug ID: 29969 Summary: Fail to load file-backed mapping from arm coredump Product: gdb Version: 10.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: jhaefliger at gmail dot com Target Milestone: --- Created attachment 14561 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D14561&action=3Ded= it Archive containing the application and coredump I'm trying to debug a crash of a simple application using a coredump. This application has been cross-compiled on a Ubuntu 18.04 host (x86_64-pc-linux-gnu) for an embedded device with an=C2=A0ARM cpu (arm-buildroot-linux-uclibcgnueabi). I used buildroot as system builder to = make my distribution and run it with qemu (the issue is the same if I use the device) Application is very simple. It makes just an exception and then, Linux generates a coredump accordingly: #include int main() { std::cout << "Hello World! \n"; throw std::exception(); return 0; } This application has been compiled with gcc using following command: arm-buildroot-linux-uclibcgnueabi-g++ -c -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=3D64 -Os -g0 --sysroot=3D/home/jerome/dev/oem/distro/buildroot/output/host/arm-buildroot= -linux-uclibcgnueabi/sysroot -O0 -g -std=3Dgnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_QML_DEBUG -I../hello-world -I. -I../oem/distro/buildroot/output/host/mkspecs/devices/linux-buildroot-g++ -o main.o ../hello-world/main.cpp GCC version is 11.3.0 When I try opening the coredump with the binary (that includes the symbols)= on my host, gdb failed to load file-backed mapping: $ arm-buildroot-linux-uclibcgnueabi-gdb -x ~/dev/oem/distro/buildroot/output/staging/usr/share/buildroot/gdbinit hello-world hello-world.6.468.core.1857 GNU gdb (GDB) 10.2 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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 "--host=3Dx86_64-pc-linux-gnu --target=3Darm-buildroot-linux-uclibcgnueabi". 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 hello-world... warning: Can't open file /usr/bin/hello-world during file-backed mapping no= te processing warning: Can't open file /lib/libuClibc-1.0.42.so during file-backed mapping note processing warning: Can't open file /lib/libgcc_s.so.1 during file-backed mapping note processing warning: Can't open file /usr/lib/libstdc++.so.6.0.29 during file-backed mapping note processing warning: Can't open file /lib/libatomic.so.1.2.0 during file-backed mapping note processing warning: Can't open file /lib/ld-uClibc-1.0.42.so during file-backed mapping note processing [New LWP 1857] Core was generated by `hello-world'. Program terminated with signal SIGABRT, Aborted. #0 0xb6d44a9c in ?? () (gdb) add-symbol-file add-symbol-file takes a file name and an address (gdb) add-symbol-file hello-world add symbol table from file "hello-world" (y or n) y Reading symbols from hello-world... (gdb) bt #0 0xb6d44a9c in ?? () #1 0xbeffcc00 in ?? () (gdb) maint print core-file-backed-mappings (gdb) info proc mappings Mapped address spaces: Start Addr End Addr Size Offset objfile 0x4a0000 0x4a1000 0x1000 0x0 /usr/bin/hello-world 0x4b0000 0x4b1000 0x1000 0x0 /usr/bin/hello-world 0x4b1000 0x4b2000 0x1000 0x1000 /usr/bin/hello-world 0xb6cf5000 0xb6d64000 0x6f000 0x0 /lib/libuClibc-1.0.42.so 0xb6d73000 0xb6d74000 0x1000 0x6e000 /lib/libuClibc-1.0.42.so 0xb6d74000 0xb6d75000 0x1000 0x6f000 /lib/libuClibc-1.0.42.so 0xb6d8b000 0xb6da8000 0x1d000 0x0 /lib/libgcc_s.so.1 0xb6db7000 0xb6db8000 0x1000 0x1c000 /lib/libgcc_s.so.1 0xb6db8000 0xb6db9000 0x1000 0x1d000 /lib/libgcc_s.so.1 0xb6db9000 0xb6eff000 0x146000 0x0 /usr/lib/libstdc++.so.6.0.29 0xb6f0f000 0xb6f14000 0x5000 0x146000 /usr/lib/libstdc++.so.6.0.29 0xb6f14000 0xb6f17000 0x3000 0x14b000 /usr/lib/libstdc++.so.6.0.29 0xb6f19000 0xb6f1c000 0x3000 0x0 /lib/libatomic.so.1.2.0 0xb6f2b000 0xb6f2c000 0x1000 0x2000 /lib/libatomic.so.1.2.0 0xb6f2c000 0xb6f2d000 0x1000 0x3000 /lib/libatomic.so.1.2.0 0xb6f2e000 0xb6f34000 0x6000 0x0 /lib/ld-uClibc-1.0.42.so 0xb6f44000 0xb6f45000 0x1000 0x6000 /lib/ld-uClibc-1.0.42.so 0xb6f45000 0xb6f46000 0x1000 0x7000 /lib/ld-uClibc-1.0.42.so =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Content of gdbinit is: add-auto-load-safe-path /home/jerome/dev/oem/distro/buildroot/output/host/arm-buildroot-linux-uclib= cgnueabi/sysroot set sysroot /home/jerome/dev/oem/distro/buildroot/output/host/arm-buildroot-linux-uclib= cgnueabi/sysroot If I move the hello-world to /usr/bin/hello-world, I can display the callst= ack and is displayed as expected. I have tried different versions of GDB and this problem is not present on 9= .2 but present on 11.2. I suspect this change: https://github.com/bminor/binutils-gdb/commit/db082f5979ff95409b7de7a2a96d0= 83f2642c8c3#diff-b5a7f498799a7683f323e2c1f99ec3f921e1a1713df7480ad65fec9353= bdaa5eR215 has introduced this issue but not 100% sure it is. --=20 You are receiving this mail because: You are on the CC list for the bug.=