From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9781 invoked by alias); 2 May 2003 21:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9752 invoked by uid 71); 2 May 2003 21:46:01 -0000 Date: Fri, 02 May 2003 21:46:00 -0000 Message-ID: <20030502214601.9751.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Fred Channey Subject: Re: libstdc++/10350: thread-safety problem in std::string. Reply-To: Fred Channey X-SW-Source: 2003-05/txt/msg00158.txt.bz2 List-Id: The following reply was made to PR libstdc++/10350; it has been noted by GNATS. From: Fred Channey To: gcc-help@gcc.gnu.org, gcc@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, jkanze@caicheuvreuse.com, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org Cc: fchanney@yahoo.com Subject: Re: libstdc++/10350: thread-safety problem in std::string. Date: Fri, 2 May 2003 14:42:19 -0700 (PDT) We are having some crashes with stdc++. It happens on a 2-processor i686 machine - the crashes went away if we boot the same machine with only one processor. Also, core dumps only happen under heavy loads - no crashes if the threads are not many. The core dumps scatters over a handful of places - in std::string, std::basic_string, std::map, std::_Rb_tree, std::__default_alloc_template, std::pair, std::_List_base, std::_Rb_tree_rebalance, std::_Rb_tree_rotate_left, etc. The os is Redhat Linux 7.3, The version we have are compat-libstdc++-6.2-2.9.0.16 libstdc++3-3.0.4-1 libstdc++-2.96-113 libc-2.2.5-43 glibc-common-2.2.5-43 The cpus are processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 11 model name : Intel(R) Pentium(R) III CPU family 1266MHz stepping : 1 cpu MHz : 1266.098 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 2529.68 processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 11 model name : Intel(R) Pentium(R) III CPU family 1266MHz stepping : 1 cpu MHz : 1266.098 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 2529.68 Typical trace back of the cores are like these: --------------------------------------------------------------------------------------------------------- #0 0x082426e8 in std::basic_string, std::allocator >::_Rep::_S_create(unsigned, std::allocator const&) () #1 0x082424dc in wchar_t* std::basic_string, std::allocator >::_S_construct(wchar_t const*, wchar_t const*, std::allocator const&, std::forward_iterator_tag) (__beg=0x84b4bdc, __end=0x84b4bf0, __a=@0x41b5b50c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.tcc:143 #2 0x082423bc in std::basic_string, std::allocator >::basic_string(wchar_t const*, std::allocator const&) (this=0x41b5b60c, __s=0x84b4bdc, __a=@0x41b5b50c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:666 #3 0x081fbb9f in toString(wchar_t const*) (s=0x84b4bdc) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:571 #4 0x081fcb9e in PropertyList::SetProperties(VXMLElement const&, PropertyLevel, VXIMapHolder const&) (this=0x85c6fa4, doc=@0x85c6f48, level=DIALOG_PROP, docProps=@0x41b5b6cc) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_pair.h:84 --------------------------------------------------------------------------------------------------------- or --------------------------------------------------------------------------------------------------------- #0 0x08243539 in std::__default_alloc_template::allocate(unsigned) (__n=24) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:338 #1 0x082486c7 in std::_Rb_tree_base, std::allocator > const, std::basic_string, std::allocator > >, std::allocator, std::allocator > const, std::basic_string, std::allocator > > > >::_Rb_tree_base(std::allocator, std::allocator > const, std::basic_string, std::allocator > > > const&) (this=0x49dfe12c, __a=@0x49dfe10c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:184 #2 0x081fec9d in PropertyList::GetProperties(VXIMapHolder&) const (this=0x47a62f3c, m=@0x49dfe33c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:647 --------------------------------------------------------------------------------------------------------- or --------------------------------------------------------------------------------------------------------- #0 0x42029241 in kill () from /lib/i686/libc.so.6 #1 0x400ccc4b in raise () from /lib/i686/libpthread.so.0 #2 0x4202a7d2 in abort () from /lib/i686/libc.so.6 #3 0x40095405 in __cxxabiv1::__terminate(void (*)()) (handler=0x8055aa4 ) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47 #4 0x40095440 in __cxxabiv1::__unexpected(void (*)()) (handler=0x8386db0) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57 #5 0x400955b0 in __cxa_rethrow () at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:77 #6 0x4005ce0a in std::__throw_length_error(char const*) (__s=0x8273d51 "basic_string::_S_create") at ../../../../libstdc++-v3/src/functexcept.cc:70 #7 0x0824265f in std::basic_string, std::allocator >::_Rep::_S_create(unsigned, std::allocator const&) (__capacity=1176815353, __alloc=@0x4a9fddbc) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.tcc:368 #8 0x08242568 in std::basic_string, std::allocator >::_M_mutate(unsigned, unsigned, unsigned) (this=0x4a9fde80, __pos=103073528, __len1=0, __len2=1) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:572 #9 0x08242f8e in std::basic_string, std::allocator >::replace(std::__normal_iterator, std::allocator > >, std::__normal_iterator, std::allocator > >, unsigned, wchar_t) (this=0x4a9fde80, __i1= {> = {}, _M_current = 0x5eb7e294}, __i2= {> = {}, _M_current = 0x5eb7e294}, __n2=1, __c=57) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.tcc:566 #10 0x08242ea6 in std::basic_string, std::allocator >::append(unsigned, wchar_t) ( this=0x4a9fde80, __n=1, __c=57) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:254 #11 0x081dd391 in SBinetValidator::Serialize() const (this=0x4a9fdf0c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:460 --------------------------------------------------------------------------------------------------------- or --------------------------------------------------------------------------------------------------------- #0 std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, std::basic_string, std::allocator > >, std::_Select1st, std::allocator > const, std::basic_string, std::allocator > > >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::basic_string, std::allocator > > > >::insert_unique(std::_Rb_tree_iterator, std::allocator > const, std::basic_string, std::allocator > >, std::pair, std::allocator > const, std::basic_string, std::allocator > >&, std::pair, std::allocator > const, std::basic_string, std::allocator > >*>, std::pair, std::allocator > const, std::basic_string, std::allocator > > const&) (this=0x4b5fe12c, __position=0x4b5fe0ac, __v=@0x4b5fe0cc) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:246 #1 0x081fed79 in PropertyList::GetProperties(VXIMapHolder&) const (this=0x44281064, m=@0x4b5fe33c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:191 #2 0x08227e73 in GrammarManager::GetRecProperties(PropertyList const&, int) const (this=0x44281034, props=@0x44281064, timeout=-1) at GrammarManager.cpp:1014 --------------------------------------------------------------------------------------------------------- or --------------------------------------------------------------------------------------------------------- 0 std::_Rb_tree_rotate_left(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) (__x=0x47af89f8, __root=@0x48a1ef0c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:253 #1 0x08248458 in std::_Rb_tree_rebalance(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) (__x=0x48a6e0c8, __root=@0x48a1ef0c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:323 #2 0x0824811a in std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, std::basic_string, std::allocator > >, std::_Select1st, std::allocator > const, std::basic_string, std::allocator > > >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::basic_string, std::allocator > > > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair, std::allocator > const, std::basic_string, std::allocator > > const&) (this=0x4dcfdd6c, __x_=0x0, __y_=0x47af83c0, __v=@0x4dcfdd0c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:866 #3 0x08247a85 in std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, std::basic_string, std::allocator > >, std::_Select1st, std::allocator > const, std::basic_string, std::allocator > > >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::basic_string, std::allocator > > > >::insert_unique(std::_Rb_tree_iterator, std::allocator > const, std::basic_string, std::allocator > >, std::pair, std::allocator > const, std::basic_string, std::allocator > >&, std::pair, std::allocator > const, std::basic_string, std::allocator > >*>, std::pair, std::allocator > const, std::basic_string, std::allocator > > const&) (this=0x4dcfdd6c, __position=0x4dcfdcec, __v=@0x4dcfdd0c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:941 #4 0x081fed79 in PropertyList::GetProperties(VXIMapHolder&) const (this=0x47d795dc, m=@0x4dcfdf7c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:191 --------------------------------------------------------------------------------------------------------- or --------------------------------------------------------------------------------------------------------- #0 std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, std::basic_string, std::allocator > >, std::_Select1st, std::allocator > const, std::basic_string, std::allocator > > >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::basic_string, std::allocator > > > >::insert_unique(std::_Rb_tree_iterator, std::allocator > const, std::basic_string, std::allocator > >, std::pair, std::allocator > const, std::basic_string, std::allocator > >&, std::pair, std::allocator > const, std::basic_string, std::allocator > >*>, std::pair, std::allocator > const, std::basic_string, std::allocator > > const&) (this=0x492fe12c, __position=0x492fe0ac, __v=@0x492fe0cc) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:238 #1 0x081fed79 in PropertyList::GetProperties(VXIMapHolder&) const (this=0x48563eac, m=@0x492fe33c) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:191 #2 0x08227e73 in GrammarManager::GetRecProperties(PropertyList const&, int) const (this=0x48563e7c, props=@0x48563eac, timeout=-1) at GrammarManager.cpp:1014 --------------------------------------------------------------------------------------------------------- And I have more. The software was build with gcc 3.0.2. Any ideas? Thanks! Fred __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com