You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Mark Brown <mb...@inbox.com> on 2007/06/26 16:19:19 UTC

crash in 22.locale.num.put.mt (was RE: status of thread safety tests)

It might be more helpful if I include the debugging information. The test runs okay with just one thread in a debug build so this output is for two threads.

(gdb) r --nthreads=2
Starting program: /home/mbrown/stdcxx-gcc-4.1.1-15D/tests/22.locale.num.put.mt --nthreads=2
[Thread debugging using libthread_db enabled]
[New Thread 46912499588704 (LWP 23444)]
# INFO (S1) (10 lines):
# TEXT: 
# COMPILER: gcc 4.1.1, __VERSION__ = "4.1.1 20070105 (Red Hat 4.1.1-51)"
# ENVIRONMENT: amd64/LP64 running linux-elf (unknown release) with glibc 2.5
# FILE: 22.locale.num.put.mt.cpp
# COMPILED: Jun 26 2007, 08:08:46
# COMMENT: thread safety
############################################################

# CLAUSE: lib.locale.num.put

# NOTE (S2) (5 lines):
# TEXT: executing "locale -a > /tmp/tmpfile-6SA0KQ"
# CLAUSE: lib.locale.num.put
# FILE: process.cpp
# LINE: 274

# INFO (S1) (3 lines):
# TEXT: testing std::num_put<charT> with 2 threads, 200000 iterations each, in locales { "aa_DJ" "aa_DJ.iso88591" "aa_DJ.utf8" "aa_ER" "aa_ER@saaho" "aa_ER.utf8" "aa_ER.utf8@saaho" "aa_ET" "aa_ET.utf8" "af_ZA" "af_ZA.iso88591" "af_ZA.utf8" "am_ET" "am_ET.utf8" "an_ES" "an_ES.iso885915" "an_ES.utf8" "ar_AE" "ar_AE.iso88596" "ar_AE.utf8" "ar_BH" "ar_BH.iso88596" "ar_BH.utf8" "ar_DZ" "ar_DZ.iso88596" "ar_DZ.utf8" "ar_EG" "ar_EG.iso88596" "ar_EG.utf8" "ar_IN" "ar_IN.utf8" "ar_IQ" }
# CLAUSE: lib.locale.num.put

# INFO (S1) (3 lines):
# TEXT: exercising std::num_put<char>
# CLAUSE: lib.locale.num.put

[New Thread 1084229952 (LWP 23447)]
[New Thread 1094719808 (LWP 23448)]
*** glibc detected *** /home/mbrown/stdcxx-gcc-4.1.1-15D/tests/22.locale.num.put.mt: double free or corruption (fasttop): 0x0000000000649720 ***
======= Backtrace: =========
/lib64/libc.so.6[0x39f826ea30]
/lib64/libc.so.6(cfree+0x8c)[0x39f827214c]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZN4__rw15__rw_deallocateEPvmi+0x1c)[0x2aaaaab18a9e]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZNSaIcE10deallocateEPcm+0x26)[0x2aaaaab29626]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZNSs9_C_unlinkEPc+0xb6)[0x2aaaaab296de]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZNSsD1Ev+0x1a)[0x2aaaaab2ec86]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6_C_putES3_RSt8ios_baseciPKv+0x6b2)[0x2aaaaab35448]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecl+0x3d)[0x2aaaaab3564b]
/home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so(_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecl+0x43)[0x2aaaaab26c07]
/home/mbrown/stdcxx-gcc-4.1.1-15D/tests/22.locale.num.put.mt[0x405091]
/lib64/libpthread.so.0[0x39fae06305]
/lib64/libc.so.6(clone+0x6d)[0x39f82cd50d]
======= Memory map: ========
00400000-0042c000 r-xp 00000000 08:02 22086788                           /home/mbrown/stdcxx-gcc-4.1.1-15D/tests/22.locale.num.put.mt
0062c000-0062e000 rw-p 0002c000 08:02 22086788                           /home/mbrown/stdcxx-gcc-4.1.1-15D/tests/22.locale.num.put.mt
0062e000-00651000 rw-p 0062e000 00:00 0                                  [heap]
40000000-40001000 ---p 40000000 00:00 0 
40001000-40a01000 rwxp 40001000 00:00 0 
40a01000-40a02000 ---p 40a01000 00:00 0 
40a02000-41402000 rwxp 40a02000 00:00 0 
39f7000000-39f701a000 r-xp 00000000 08:02 17006594                       /lib64/ld-2.5.so
39f7219000-39f721a000 r--p 00019000 08:02 17006594                       /lib64/ld-2.5.so
39f721a000-39f721b000 rw-p 0001a000 08:02 17006594                       /lib64/ld-2.5.so
39f8200000-39f8344000 r-xp 00000000 08:02 17006597                       /lib64/libc-2.5.so
39f8344000-39f8544000 ---p 00144000 08:02 17006597                       /lib64/libc-2.5.so
39f8544000-39f8548000 r--p 00144000 08:02 17006597                       /lib64/libc-2.5.so
39f8548000-39f8549000 rw-p 00148000 08:02 17006597                       /lib64/libc-2.5.so
39f8549000-39f854e000 rw-p 39f8549000 00:00 0 
39f8600000-39f8682000 r-xp 00000000 08:02 17006804                       /lib64/libm-2.5.so
39f8682000-39f8881000 ---p 00082000 08:02 17006804                       /lib64/libm-2.5.so
39f8881000-39f8882000 r--p 00081000 08:02 17006804                       /lib64/libm-2.5.so
39f8882000-39f8883000 rw-p 00082000 08:02 17006804                       /lib64/libm-2.5.so
39fae00000-39fae15000 r-xp 00000000 08:02 17006792                       /lib64/libpthread-2.5.so
39fae15000-39fb014000 ---p 00015000 08:02 17006792                       /lib64/libpthread-2.5.so
39fb014000-39fb015000 r--p 00014000 08:02 17006792                       /lib64/libpthread-2.5.so
39fb015000-39fb016000 rw-p 00015000 08:02 17006792                       /lib64/libpthread-2.5.so
39fb016000-39fb01a000 rw-p 39fb016000 00:00 0 
3a05000000-3a0500d000 r-xp 00000000 08:02 17006751                       /lib64/libgcc_s-4.1.1-20070105.so.1
3a0500d000-3a0520c000 ---p 0000d000 08:02 17006751                       /lib64/libgcc_s-4.1.1-20070105.so.1
3a0520c000-3a0520d000 rw-p 0000c000 08:02 17006751                       /lib64/libgcc_s-4.1.1-20070105.so.1
2aaaaaaab000-2aaaaaaad000 rw-p 2aaaaaaab000 00:00 0 
2aaaaaaad000-2aaaaabbb000 r-xp 00000000 08:02 22086136                   /home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so.4.2.0
2aaaaabbb000-2aaaaadbb000 ---p 0010e000 08:02 22086136                   /home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so.4.2.0
2aaaaadbb000-2aaaaadc5000 rw-p 0010e000 08:02 22086136                   /home/mbrown/stdcxx-gcc-4.1.1-15D/lib/libstd15D.so.4.2.0
2aaaaadc5000-2aaaaaddd000 rw-p 2aaaaadc5000 00:00 0 
2aaaaadf7000-2aaaaadfb000 rw-p 2aaaaadf7000 00:00 0 
2aaaaadfb000-2aaaae2ef000 r--p 00000000 08:02 25982014                   /usr/lib/locale/locale-archive
2aaab0000000-2aaab0021000 rw-p 2aaab0000000 00:00 0 
2aaab0021000-2aaab4000000 ---p 2aaab0021000 00:00 0 
7fff6529c000-7fff652b0000 rwxp 7fff6529c000 00:00 0                      [stack]
7fff652b0000-7fff652b1000 rw-p 7fff652b0000 00:00 0 
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0                  [vdso]

Program received signal SIGABRT, Aborted.
[Switching to Thread 1084229952 (LWP 23447)]
0x00000039f82301b5 in raise () from /lib64/libc.so.6
(gdb) where
#0  0x00000039f82301b5 in raise () from /lib64/libc.so.6
#1  0x00000039f8231b20 in abort () from /lib64/libc.so.6
#2  0x00000039f826766b in __libc_message () from /lib64/libc.so.6
#3  0x00000039f826ea30 in _int_free () from /lib64/libc.so.6
#4  0x00000039f827214c in free () from /lib64/libc.so.6
#5  0x00002aaaaab18a9e in __rw::__rw_deallocate (p=0x649720)
    at /home/mbrown/stdcxx/src/memory.cpp:81
#6  0x00002aaaaab29626 in std::allocator<char>::deallocate (this=0x409feb30, 
    __p=0x649720 "����", __n=58)
    at /home/mbrown/stdcxx/include/rw/_allocator.h:157
#7  0x00002aaaaab296de in std::string::_C_unlink (this=0x409feb30, __ptr=0x0)
    at /home/mbrown/stdcxx/include/string:916
#8  0x00002aaaaab2ec86 in ~basic_string (this=0x409feb30)
    at /home/mbrown/stdcxx/include/string:199
#9  0x00002aaaaab35448 in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_C_put (this=0x2aaaaadca740, __it=
      {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, _C_sb = 0x409fed60}, __flags=@0x409fede0, __fill=32 ' ', 
    __type=2309, __pval=0xffffffffffffffef)
    at /home/mbrown/stdcxx/include/loc/_num_put.cc:205
#10 0x00002aaaaab3564b in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put (this=0x2aaaaadca740, __it=
      {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, _C_sb = 0x409fed60}, __flags=@0x409fede0, __fill=32 ' ', __val=-17)
    at /home/mbrown/stdcxx/include/loc/_num_put.h:140
#11 0x00002aaaaab26c07 in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put (this=0x2aaaaadca740, __it=
      {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, _C_sb = 0x409fed60}, __flags=@0x409fede0, __fill=32 ' ', __val=-17)
    at /home/mbrown/stdcxx/include/loc/_num_put.h:75
#12 0x0000000000405091 in thread_func ()
    at /home/mbrown/stdcxx/tests/localization/22.locale.num.put.mt.cpp:177
#13 0x00000039fae06305 in start_thread () from /lib64/libpthread.so.0
#14 0x00000039f82cd50d in clone () from /lib64/libc.so.6
#15 0x0000000000000000 in ?? ()


-- Mark


> -----Original Message-----
> From: mbrown@inbox.com
> Sent: Tue, 26 Jun 2007 06:05:57 -0800
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: status of thread safety tests
> 
> 22.locale.num.put.mt gets a SIGSEGV on my system (Fedora 6) even with a
> single thread. Here's the output of gdb:
> 
> $ gdb ./22.locale.num.put.mt
> GNU gdb Red Hat Linux (6.5-15.fc6rh)
> Copyright (C) 2006 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-redhat-linux-gnu"...
> (no debugging symbols found)
> Using host libthread_db library "/lib64/libthread_db.so.1".
> 
> (gdb) run --nthreads=1
> Starting program:
> /home/mbrown/stdcxx-gcc-4.1.1-12D/tests/22.locale.num.put.mt -
> -nthreads=1
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> [Thread debugging using libthread_db enabled]
> [New Thread 46912499232352 (LWP 32189)]
> (no debugging symbols found)
> # INFO (S1) (10 lines):
> # TEXT:
> # COMPILER: gcc 4.1.1, __VERSION__ = "4.1.1 20070105 (Red Hat 4.1.1-51)"
> # ENVIRONMENT: amd64/LP64 running linux-elf (unknown release) with glibc
> 2.5
> # FILE: 22.locale.num.put.mt.cpp
> # COMPILED: Jun 26 2007, 07:52:50
> # COMMENT: thread safety
> ############################################################
> 
> # CLAUSE: lib.locale.num.put
> 
> # NOTE (S2) (5 lines):
> # TEXT: executing "locale -a > /tmp/tmpfile-st2gNr"
> # CLAUSE: lib.locale.num.put
> # FILE: process.cpp
> # LINE: 274
> 
> # INFO (S1) (3 lines):
> # TEXT: testing std::num_put<charT> with 1 thread, 200000 iterations
> each, in lo
> cales { "aa_DJ" "aa_DJ.iso88591" "aa_DJ.utf8" "aa_ER" "aa_ER@saaho"
> "aa_ER.utf8"
>  "aa_ER.utf8@saaho" "aa_ET" "aa_ET.utf8" "af_ZA" "af_ZA.iso88591"
> "af_ZA.utf8" "
> am_ET" "am_ET.utf8" "an_ES" "an_ES.iso885915" "an_ES.utf8" "ar_AE"
> "ar_AE.iso885
> 96" "ar_AE.utf8" "ar_BH" "ar_BH.iso88596" "ar_BH.utf8" "ar_DZ"
> "ar_DZ.iso88596"
> "ar_DZ.utf8" "ar_EG" "ar_EG.iso88596" "ar_EG.utf8" "ar_IN" "ar_IN.utf8"
> "ar_IQ"
> }
> # CLAUSE: lib.locale.num.put
> 
> # INFO (S1) (3 lines):
> # TEXT: exercising std::num_put<char>
> # CLAUSE: lib.locale.num.put
> 
> [New Thread 1084229952 (LWP 32194)]
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1084229952 (LWP 32194)]
> 0x00002aaaaaafb027 in std::locale::locale ()
>    from /home/mbrown/stdcxx-gcc-4.1.1-12D/lib/libstd12D.so
> (gdb) where
> #0  0x00002aaaaaafb027 in std::locale::locale ()
>    from /home/mbrown/stdcxx-gcc-4.1.1-12D/lib/libstd12D.so
> #1  0x0000000000403eea in thread_func ()
> #2  0x00000039fae06305 in start_thread () from /lib64/libpthread.so.0
> #3  0x00000039f82cd50d in clone () from /lib64/libc.so.6
> #4  0x0000000000000000 in ?? ()
> 
> 
> -- Mark
> 
> 
>> -----Original Message-----
>> From: sebor@roguewave.com
>> Sent: Mon, 18 Jun 2007 21:20:27 -0600
>> To: stdcxx-dev@incubator.apache.org
>> Subject: status of thread safety tests
>> 
>> I've been working on a document listing the thread safety tests
>> in stdcxx/trunk and their current status:
>> 
>>    http://people.apache.org/~sebor/thread_safety_tests.html
>> 
>> The goal is to have a full understanding of all the problems
>> and address them (or at least the most important ones) in the
>> final 4.2.0 release.
>> 
>> The document is still a work in progress, as is the test suite.
>> Not all tests have been migrated from the Rogue Wave test suite
>> in Perforce over to ASF Subversion. For those tests the links
>> that point to the Perforce source repository won't work.

____________________________________________________________
PREVENT ACCESSING DANGEROUS WEBSITES - Protect your computer with Free Web Security Guard! 
More information at http://www.inbox.com/wsg