From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01EE93858005; Wed, 10 Aug 2022 21:18:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01EE93858005 From: "lancethepants at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106581] New: [Aarch64] libstdc++ segfault at end of execution Date: Wed, 10 Aug 2022 21:18:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lancethepants at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2022 21:18:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106581 Bug ID: 106581 Summary: [Aarch64] libstdc++ segfault at end of execution Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: lancethepants at gmail dot com Target Milestone: --- aarch64 linux 4.1.51 GCC 12.1 uclibc-ng 1.0.41 All dynamically linked c++ executables will segfault. Some executables will run then segfault, some just segfault. I think there are couple segfaulting issues, but this is the first one to address I think. GCC 10 & 11 don't segfault at the end of execution if they don't segfault for some other reas= on.=20 Static linked binaries don't segfault at the end of execution using either '-static' for fully static binary or '-static-libstdc++' to static link just libstdc++. Here is a backtrace of segfaulting 'hello world' c++ binary admin@RT-AX88U-6860:~/src/hello.src# /opt/bin/gdb ./hello GNU gdb (GDB) 11.2 Copyright (C) 2022 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 "aarch64-openwrt-linux". 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... (gdb) run Starting program: /mmc/src/hello.src/hello warning: Unable to determine the number of hardware watchpoints available. warning: Unable to determine the number of hardware breakpoints available. warning: File "/mmc/lib/libthread_db-1.0.41.so" auto-loading has been decli= ned by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". To enable execution of this file add add-auto-load-safe-path /mmc/lib/libthread_db-1.0.41.so line to your configuration file "/mmc/.config/gdb/gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/mmc/.config/gdb/gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the she= ll: info "(gdb)Auto-loading safe path" warning: Unable to find libthread_db matching inferior's thread library, th= read debugging will not be available. Hello, World from C++! Program received signal SIGSEGV, Segmentation fault. std::uncaught_exception () at ../../../../libstdc++-v3/libsupc++/eh_catch.cc:141 141 ../../../../libstdc++-v3/libsupc++/eh_catch.cc: No such file or directory. (gdb) backtrace #0 std::uncaught_exception () at ../../../../libstdc++-v3/libsupc++/eh_catch.cc:141 #1 0x0000007fb7f0bd30 in std::ostream::sentry::~sentry (this=3D0x7ffffff34= 0, __in_chrg=3D) at /home/lance/tomatoware/toolchain/buildroot-git/output/build/host-gcc-final-= 12.1.0/build/aarch64-tomatoware-linux-uclibc/libstdc++-v3/include/ostream:4= 66 #2 0x0000007fb7f0bde4 in std::ostream::flush (this=3D0x7fb7fe4f48 ) at /home/lance/tomatoware/toolchain/buildroot-git/output/build/host-gcc-final-= 12.1.0/build/aarch64-tomatoware-linux-uclibc/libstdc++-v3/include/bits/ostr= eam.tcc:245 #3 0x0000007fb7ebbc40 in std::ios_base::Init::~Init (this=3D, __in_chrg=3D) at ../../../../../libstdc++-v3/src/c++98/ios_init.cc:135 #4 0x0000007fb7d401b8 in __exit_handler (status=3D0) at libc/stdlib/_atexit.c:263 #5 0x0000007fb7d402b8 in __GI_exit (rv=3D0) at libc/stdlib/_atexit.c:301 #6 0x0000007fb7d46134 in __uClibc_main (main=3D0x55555559d4 , argc= =3D1, argv=3D0x7ffffff598, app_init=3D0x55555557d8 <_init>, app_fini=3D0x5555555a= 78 <_fini>, rtld_fini=3D0x7fb7fe94f0 <_dl_fini>, stack_end=3D0x7ffffff590) at libc/misc/internals/__uClibc_main.c:552 #7 0x00000055555558c4 in _start () at libc/sysdeps/linux/aarch64/crt1.S:92 Backtrace stopped: previous frame identical to this frame (corrupt stack?)=