Details
Description
When compiled with gcc 4.3.0 (but not earlier versions) with -O2 on Linux/x86_64 the 20.auto.ptr.cpp test barfs at runtime:
$ gdb ./20.auto.ptr GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-suse-linux"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) r -q Starting program: /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr -q [Thread debugging using libthread_db enabled] [New Thread 47873585794736 (LWP 3611)] # ASSERTION (S7) (4 lines): # TEXT: auto_ptr<>::auto_ptr(std::auto_ptr_ref) # CLAUSE: lib.auto.ptr # LINE: 377 *** glibc detected *** /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr: munmap_chunk(): invalid pointer: 0x00007fff3b2a9e90 *** ======= Backtrace: ========= /lib64/libc.so.6[0x2b8a6ff6e37e] /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr[0x402390] /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr[0x40567f] /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr[0x405b28] /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr(_ZNSt8ios_base4InitD1Ev+0x250)[0x402088] /lib64/libc.so.6(__libc_start_main+0xf4)[0x2b8a6ff20154] /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr(_ZNSt8ios_base4InitD1Ev+0x141)[0x401f79] ======= Memory map: ======== 00400000-00426000 r-xp 00000000 fd:00 723719 /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr 00526000-00527000 rw-p 00026000 fd:00 723719 /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/tests/20.auto.ptr 00527000-0054a000 rw-p 00527000 00:00 0 [heap] 2b8a6f7fe000-2b8a6f819000 r-xp 00000000 fd:03 98312 /lib64/ld-2.4.so 2b8a6f819000-2b8a6f81b000 rw-p 2b8a6f819000 00:00 0 2b8a6f919000-2b8a6f91b000 rw-p 0001b000 fd:03 98312 /lib64/ld-2.4.so 2b8a6f91b000-2b8a6fa31000 r-xp 00000000 fd:00 723482 /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/lib/libstd15D.so.4.2.2 2b8a6fa31000-2b8a6fb30000 ---p 00116000 fd:00 723482 /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/lib/libstd15D.so.4.2.2 2b8a6fb30000-2b8a6fb3a000 rw-p 00115000 fd:00 723482 /build/sebor/stdcxx-4.2.x-gcc-4.3.0-15D/lib/libstd15D.so.4.2.2 2b8a6fb3a000-2b8a6fb52000 rw-p 2b8a6fb3a000 00:00 0 2b8a6fb81000-2b8a6fbd5000 r-xp 00000000 fd:03 98327 /lib64/libm-2.4.so 2b8a6fbd5000-2b8a6fcd4000 ---p 00054000 fd:03 98327 /lib64/libm-2.4.so 2b8a6fcd4000-2b8a6fcd6000 rw-p 00053000 fd:03 98327 /lib64/libm-2.4.so 2b8a6fcd6000-2b8a6fcec000 r-xp 00000000 00:19 1851300 /amd/devco/contrib/linux/gcc-4.3.0/lib64/libgcc_s.so.1 2b8a6fcec000-2b8a6fdeb000 ---p 00016000 00:19 1851300 /amd/devco/contrib/linux/gcc-4.3.0/lib64/libgcc_s.so.1 2b8a6fdeb000-2b8a6fdec000 rw-p 00015000 00:19 1851300 /amd/devco/contrib/linux/gcc-4.3.0/lib64/libgcc_s.so.1 2b8a6fdec000-2b8a6fded000 rw-p 2b8a6fdec000 00:00 0 2b8a6fded000-2b8a6fdfe000 r-xp 00000000 fd:03 98345 /lib64/libpthread-2.4.so 2b8a6fdfe000-2b8a6fefd000 ---p 00011000 fd:03 98345 /lib64/libpthread-2.4.so 2b8a6fefd000-2b8a6feff000 rw-p 00010000 fd:03 98345 /lib64/libpthread-2.4.so 2b8a6feff000-2b8a6ff03000 rw-p 2b8a6feff000 00:00 0 2b8a6ff03000-2b8a70029000 r-xp 00000000 fd:03 98319 /lib64/libc-2.4.so 2b8a70029000-2b8a70129000 ---p 00126000 fd:03 98319 /lib64/libc-2.4.so 2b8a70129000-2b8a7012c000 r--p 00126000 fd:03 98319 /lib64/libc-2.4.so 2b8a7012c000-2b8a7012e000 rw-p 00129000 fd:03 98319 /lib64/libc-2.4.so 2b8a7012e000-2b8a70136000 rw-p 2b8a7012e000 00:00 0 7fff3b296000-7fff3b2aa000 rwxp 7fff3b296000 00:00 0 [stack] 7fff3b2aa000-7fff3b2ac000 rw-p 7fff3b2aa000 00:00 0 ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso] Program received signal SIGABRT, Aborted. [Switching to Thread 47873585794736 (LWP 3611)] 0x00002b8a6ff32aa5 in raise () from /lib64/libc.so.6 (gdb) where #0 0x00002b8a6ff32aa5 in raise () from /lib64/libc.so.6 #1 0x00002b8a6ff33e60 in abort () from /lib64/libc.so.6 #2 0x00002b8a6ff6936b in __libc_message () from /lib64/libc.so.6 #3 0x00002b8a6ff6e37e in malloc_printerr () from /lib64/libc.so.6 #4 0x0000000000402390 in run_test () at /amd/devco/sebor/stdcxx-4.2.x/include/rw/_autoptr.h:220 #5 0x000000000040567f in rw_vtest (argc=2, argv=0x7fff3b2a9e88, file_name=0x41b720 "/amd/devco/sebor/stdcxx-4.2.x/tests/utilities/20.auto.ptr.cpp", clause=0x41b8a4 "lib.auto.ptr", comment=0x0, fun=0x402090 <run_test>, optstr=0x41b8b1 "|-no-conversions#", va=0x7fff3b2a9cb0) at /amd/devco/sebor/stdcxx-4.2.x/tests/src/driver.cpp:1174 #6 0x0000000000405b28 in rw_test (argc=2, argv=0x7fff3b2a9e88, fname=0x41b720 "/amd/devco/sebor/stdcxx-4.2.x/tests/utilities/20.auto.ptr.cpp", clause=0x41b8a4 "lib.auto.ptr", comment=0x0, testfun=0x402090 <run_test>, optstr=0x41b8b1 "|-no-conversions#") at /amd/devco/sebor/stdcxx-4.2.x/tests/src/driver.cpp:1272 #7 0x0000000000402088 in main (argc=3611, argv=0xe1b) at /amd/devco/sebor/stdcxx-4.2.x/tests/utilities/20.auto.ptr.cpp:481 (gdb)