https://sourceware.org/bugzilla/show_bug.cgi?id=32032
Bug ID: 32032 Summary: dwp segfaults on hello world binary Product: binutils Version: 2.42 Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: top.gate9722 at fastmail dot com Target Milestone: --- Created attachment 15650 --> https://sourceware.org/bugzilla/attachment.cgi?id=15650&action=edit Arch Linux failure for GCC # Description dwp segfaults when I try to run it on a binary that was compiled with `-g -gsplit-dwarf`. Failure occurs on Arch Linux (native OS) and Ubuntu 20.04 (Docker image), with GCC and Clang. # dwp info Native ``` $ dwp --version GNU dwp (GNU Binutils) 2.42.50.20240516 Copyright (C) 2024 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. ``` Docker ``` $ dwp --version GNU dwp (GNU Binutils for Ubuntu) 2.42 Copyright (C) 2024 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. ``` # Patches None. # System info Native ``` $ lsb_release -a LSB Version: n/a Distributor ID: Arch Description: Arch Linux Release: rolling Codename: n/a ``` Docker ``` $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble ``` # Compiler info Native GCC ``` $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/cjdb/opt/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/cjdb/opt --enable-languages=c,c++ --disable-nls --with-build-config=bootstrap-lto-lean --disable-werror Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 15.0.0 20240623 (experimental) (GCC) ``` Native Clang ``` $ clang -v clang version 19.0.0git (https://github.com/llvm/llvm-project.git 81671fe0e21e25f31b8100297f829744e66df4bd) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/cjdb/opt/bin Found candidate GCC installation: /home/cjdb/opt/bin/../lib/gcc/x86_64-pc-linux-gnu/15.0.0 Selected GCC installation: /home/cjdb/opt/bin/../lib/gcc/x86_64-pc-linux-gnu/15.0.0 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Selected multilib: .;@m64 ``` Docker GCC ``` $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/14/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 14-20240412-0ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-14-OQFzmN/gcc-14-14-20240412/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-14-OQFzmN/gcc-14-14-20240412/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=yes,extra,rtl --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.1 20240412 (experimental) [master r14-9935-g67e1433a94f] (Ubuntu 14-20240412-0ubuntu1) ``` Docker Clang ``` $ clang -v Ubuntu clang version 19.0.0 (++20240721081714+0caf0c93e759-1~exp1~20240721081828.299) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-19/bin Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/13 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/14 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/14 Candidate multilib: .;@m64 Selected multilib: .;@m64 ``` # Commands run Native GCC ``` $ cat hello.cpp #include <iostream> int main() { int a; std::cin >> a; std::cout << (a + 1) << '\n'; } $ g++ -c -o hello.o hello.cpp -g -gsplit-dwarf $ ls hello.cpp hello.dwo hello.o $ g++ -o hello hello.o $ ./hello 10 11 $ dwp -e hello Segmentation fault (core dumped) ``` Native Clang ``` $ rm hello hello.dwo hello.o $ clang++ -c -o hello.o hello.cpp -g -gsplit-dwarf $ clang++ -o hello hello.o $ ls hello hello.cpp hello.dwo hello.o $ ./hello 13 14 $ dwp -e hello Segmentation fault (core dumped) ``` Docker GCC ``` $ g++ -c -o hello.o hello.cpp -g -gsplit-dwarf $ g++ -o hello hello.o $ ls hello hello.cpp hello.dwo hello.o $ ./hello 10 11 $ dwp -e hello Segmentation fault (core dumped) ``` Docker Clang ``` $ rm hello hello.dwo hello.o $ clang++ -c -o hello.o hello.cpp -g -gsplit-dwarf $ clang++ -o hello hello.o $ ls hello hello.cpp hello.dwo hello.o $ ./hello 13 14 $ dwp -e hello Segmentation fault (core dumped) ``` -- You are receiving this mail because: You are on the CC list for the bug.