public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/10350: thread-safety problem in std::string.
@ 2003-05-02 21:36 Fred Channey
0 siblings, 0 replies; 4+ messages in thread
From: Fred Channey @ 2003-05-02 21:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/10350; it has been noted by GNATS.
From: Fred Channey <fchanney@yahoo.com>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, jkanze@caicheuvreuse.com,
nobody@gcc.gnu.org, libstdc++@gcc.gnu.org, help@gcc.gnu.org,
gcc-prs@gcc.gnu.org
Cc:
Subject: Re: libstdc++/10350: thread-safety problem in std::string.
Date: Fri, 2 May 2003 14:31:02 -0700 (PDT)
--0-1749463627-1051911062=:95428
Content-Type: text/plain; charset=us-ascii
We are having some similar 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<wchar_t>, 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 Li nux 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.68processor : 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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned, std::allocator<wchar_t> const&) ()
#1 0x082424dc in wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> 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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> 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<true, 0>::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::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::_Rb_tree_base(std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, st d::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > 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 <abort>)
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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned, std::allocator<wchar_t> 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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::replace(std::__normal_iterator<wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__normal_iterator<wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, unsigned, wchar_t) (this=0x4a9fde80, __i1=
{<iterator<std::random_access_iterator_tag,wchar_t,int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_current = 0x5eb7e294},
__i2=
{<iterator<std::random_access_iterator_tag,wchar_t,int,wchar_t*,wchar_t&>> = {<No data fields>}, _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<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::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::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std: :pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::insert_unique(std::_Rb_tree_iterator<std: :pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >&, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std ::allocator<wchar_t> > >*>, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > 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::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic _string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > 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::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic _string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::insert_unique(std::_Rb_tree_iterator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::pair<std::basic_s tring<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >&, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >*>, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wcha r_t> > > 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::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std: :pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::insert_unique(std::_Rb_tree_iterator<std: :pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >&, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std ::allocator<wchar_t> > >*>, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > 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.
--0-1749463627-1051911062=:95428
Content-Type: text/html; charset=us-ascii
<DIV>We are having some similar 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.</DIV>
<DIV> </DIV>
<DIV>Also, core dumps only happen under heavy loads - no crashes if the threads are not many.</DIV>
<DIV> </DIV>
<DIV>The core dumps scatters over a handful of places - in std::string, std::basic_string<wchar_t>, std::map, std::_Rb_tree, std::__default_alloc_template, std::pair, std::_List_base, std::_Rb_tree_rebalance, std::_Rb_tree_rotate_left, etc.</DIV>
<DIV> </DIV>
<DIV>The os is Redhat Linux 7.3, The version we have are </DIV>
<DIV> </DIV>
<DIV>compat-libstdc++-6.2-2.9.0.16<BR>libstdc++3-3.0.4-1<BR>libstdc++-2.96-113<BR></DIV>
<DIV>libc-2.2.5-43<BR>glibc-common-2.2.5-43<BR></DIV>
<DIV>The cpus are </DIV>
<DIV>processor : 0<BR>vendor_id : GenuineIntel<BR>cpu family : 6<BR>model : 11<BR>model name : Intel(R) Pentium(R) III CPU family 1266MHz<BR>stepping : 1<BR>cpu MHz : 1266.098<BR>cache size &nbs p; : 512 KB<BR>fdiv_bug : no<BR>hlt_bug : no<BR>f00f_bug : no<BR>coma_bug : no<BR>fpu : yes<BR>fpu_exception : yes<BR>cpuid level : 2<BR>wp : yes<BR>flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse<BR>bogomips : 2529.68</DIV>
<DIV>processor : 1<BR>vendor_id : GenuineIntel<BR>cpu family : 6<BR>model : 11<BR>model name : Intel(R) Pentium(R) III CPU family 1266MHz<BR>stepping : 1<BR>cpu MHz : 1266.098<BR>cache size &nbs p; : 512 KB<BR>fdiv_bug : no<BR>hlt_bug : no<BR>f00f_bug : no<BR>coma_bug : no<BR>fpu : yes<BR>fpu_exception : yes<BR>cpuid level : 2<BR>wp : yes<BR>flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse<BR>bogomips : 2529.68</DIV>
<DIV> </DIV>
<DIV>Typical trace back of the cores are like these:</DIV>
<DIV> </DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV>
<DIV>#0 0x082426e8 in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_create(unsigned, std::allocator<wchar_t> const&) ()<BR>#1 0x082424dc in wchar_t* std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_construct<wchar_t const*>(wchar_t const*, wchar_t const*, std::allocator<wchar_t> const&, std::forward_iterator_tag) (__beg=0x84b4bdc, __end=0x84b4bf0, <BR>&nbs p; <A href="mailto:__a=@0x41b5b50c">__a=@0x41b5b50c</A>) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.tcc:143<BR>#2 0x082423bc in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(wchar_t const*, std::allocator<wchar_t> const&) (this=0x41b5b60c, __s=0x84b4bdc, <A href="mailto:__a=@0x41b5b50c">__a=@0x41b5b50c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:666<BR>#3&nbs p; 0x081fbb9f in toString(wchar_t const*) (s=0x84b4bdc) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:571<BR>#4 0x081fcb9e in PropertyList::SetProperties(VXMLElement const&, PropertyLevel, VXIMapHolder const&) (this=0x85c6fa4, <BR> <A href="mailto:doc=@0x85c6f48">doc=@0x85c6f48</A>, level=DIALOG_PROP, <A href="mailto:docProps=@0x41b5b6cc">docProps=@0x41b5b6cc</A>) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_pair.h:84<BR>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>or</DIV>
<DIV> </DIV>
<DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV>#0 0x08243539 in std::__default_alloc_template<true, 0>::allocate(unsigned) (__n=24)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:338<BR>#1 0x082486c7 in std::_Rb_tree_base<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits< wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::_Rb_tree_base(std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t >, std::allocator<wchar_t> > > > const&) (this=0x49dfe12c, <BR> <A href="mailto:__a=@0x49dfe10c">__a=@0x49dfe10c</A>) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_alloc.h:184<BR>#2 0x081fec9d in PropertyList::GetProperties(VXIMapHolder&) const (this=0x47a62f3c, <A href="mailto:m=@0x49dfe33c">m=@0x49dfe33c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:647<BR>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>or</DIV>
<DIV> </DIV>
<DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV>#0 0x42029241 in kill () from /lib/i686/libc.so.6<BR>#1 0x400ccc4b in raise () from /lib/i686/libpthread.so.0<BR>#2 0x4202a7d2 in abort () from /lib/i686/libc.so.6<BR>#3 0x40095405 in __cxxabiv1::__terminate(void (*)()) (handler=0x8055aa4 <abort>)<BR> at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47<BR>#4 0x40095440 in __cxxabiv1:: __unexpected(void (*)()) (handler=0x8386db0) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57<BR>#5 0x400955b0 in __cxa_rethrow () at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:77<BR>#6 0x4005ce0a in std::__throw_length_error(char const*) (__s=0x8273d51 "basic_string::_S_create")<BR> at ../../../../libstdc++-v3/src/functexcept.cc:70<BR>#7 0x0824265f in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_ create(unsigned, std::allocator<wchar_t> const&) (__capacity=1176815353, <A href="mailto:__alloc=@0x4a9fddbc">__alloc=@0x4a9fddbc</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.tcc:368<BR>#8 0x08242568 in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_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 <BR>#9 0x08242f8e in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::replace(std::__normal_iterator<wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::__normal_iterator<wchar_t*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, unsigned, wchar_t) (this=0x4a9fde80, __i1=<BR> {<iterator<std ::random_access_iterator_tag,wchar_t,int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_current = 0x5eb7e294}, <BR> __i2=<BR> {<iterator<std::random_access_iterator_tag,wchar_t,int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_current = 0x5eb7e294}, <BR> __n2=1, __c=57) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.tcc:566<BR>#10 0x08242ea6 in std::basic_string<wchar_t, std::char_traits<wch ar_t>, std::allocator<wchar_t> >::append(unsigned, wchar_t) (<BR> this=0x4a9fde80, __n=1, __c=57) at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:254<BR>#11 0x081dd391 in SBinetValidator::Serialize() const (this=0x4a9fdf0c)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/basic_string.h:460<BR>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>or</DIV>
<DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>#0 std::_Rb_tree<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<w char_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::insert_unique(std::_Rb_tree_iterator<std::pair<std: :basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >&, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std ::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >*>, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > const&) (this=0x4b5fe12c, __position=0x4b5fe0ac, <BR> <A href="mailto:__v=@0x4b5fe0cc">__v=@0x4b5fe0cc</A>) at /usr/loca l/gcc-3.0.2/include/g++-v3/bits/basic_string.h:246<BR>#1 0x081fed79 in PropertyList::GetProperties(VXIMapHolder&) const (this=0x44281064, <A href="mailto:m=@0x4b5fe33c">m=@0x4b5fe33c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:191<BR>#2 0x08227e73 in GrammarManager::GetRecProperties(PropertyList const&, int) const (this=0x44281034, <A href="mailto:props=@0x44281064">props=@0x44281064</A>, timeout=-1)<BR> at GrammarManager.cpp:1014< BR>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>or</DIV>
<DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>0 std::_Rb_tree_rotate_left(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) (__x=0x47af89f8, <A href="mailto:__root=@0x48a1ef0c">__root=@0x48a1ef0c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:253<BR>#1 0x08248458 in std::_Rb_tree_rebalance(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) (__x=0x48a6e0c8, <A href="mailto:__root=@0x48a1ef0c">__root=@0x48a1ef0c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tre e.h:323<BR>#2 0x0824811a in std::_Rb_tree<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, st d::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::_M_insert(std::_Rb_tree_node_base*, s td::_Rb_tree_node_base*, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > const&) (this=0x4dcfdd6c, <BR> __x_=0x0, __y_=0x47af83c0, <A href="mailto:__v=@0x4dcfdd0c">__v=@0x4dcfdd0c</A>) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:866<BR>#3 0x08247a85 in std::_Rb_tree<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<w char_t> > > >, std::less<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::insert_unique(std::_Rb_tree_iterator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, s td::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >&, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string< wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >*>, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > const&) (this=0x4dcfdd6c, <BR> __position=0x4dcfdcec, <A href="mailto:__v=@0x4dcfdd0c">__v=@0x4dcfdd0c</A>) at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:941<BR>#4 0 x081fed79 in PropertyList::GetProperties(VXIMapHolder&) const (this=0x47d795dc, <A href="mailto:m=@0x4dcfdf7c">m=@0x4dcfdf7c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:191<BR>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>or</DIV>
<DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV></DIV>
<DIV>#0 std::_Rb_tree<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::_Select1st<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<w char_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, std::less<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::allocator<std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::insert_unique(std::_Rb_tree_iterator<std::pair<std: :basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >&, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std ::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >*>, std::pair<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > const&) (this=0x492fe12c, __position=0x492fe0ac, <BR> <A href="mailto:__v=@0x492fe0cc">__v=@0x492fe0cc</A>) at /usr/loca l/gcc-3.0.2/include/g++-v3/bits/basic_string.h:238<BR>#1 0x081fed79 in PropertyList::GetProperties(VXIMapHolder&) const (this=0x48563eac, <A href="mailto:m=@0x492fe33c">m=@0x492fe33c</A>)<BR> at /usr/local/gcc-3.0.2/include/g++-v3/bits/stl_tree.h:191<BR>#2 0x08227e73 in GrammarManager::GetRecProperties(PropertyList const&, int) const (this=0x48563e7c, <A href="mailto:props=@0x48563eac">props=@0x48563eac</A>, timeout=-1)<BR> at GrammarManager.cpp:1014< BR>
<DIV>---------------------------------------------------------------------------------------------------------</DIV>
<DIV> </DIV></DIV>
<DIV>And I have more. </DIV>
<DIV> </DIV>
<DIV>The software was build with gcc 3.0.2. </DIV>
<DIV> </DIV>
<DIV>Any ideas?</DIV>
<DIV> </DIV>
<DIV>Thanks!</DIV>
<DIV> </DIV>
<DIV>Fred</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com">The New Yahoo! Search</a> - Faster. Easier. Bingo.
--0-1749463627-1051911062=:95428--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/10350: thread-safety problem in std::string.
@ 2003-05-05 11:46 John Love-Jensen
0 siblings, 0 replies; 4+ messages in thread
From: John Love-Jensen @ 2003-05-05 11:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/10350; it has been noted by GNATS.
From: John Love-Jensen <eljay@adobe.com>
To: Fred Channey <fchanney@yahoo.com>, <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:
Subject: Re: libstdc++/10350: thread-safety problem in std::string.
Date: Mon, 05 May 2003 06:43:53 -0500
Dear Fred,
Are you protected your string access (both read and write) with mutex
protection?
--Eljay
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/10350: thread-safety problem in std::string.
@ 2003-05-02 21:46 Fred Channey
0 siblings, 0 replies; 4+ messages in thread
From: Fred Channey @ 2003-05-02 21:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/10350; it has been noted by GNATS.
From: Fred Channey <fchanney@yahoo.com>
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<wchar_t>, 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<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::_Rep::_S_create(unsigned, std::allocator<wchar_t>
const&) ()
#1 0x082424dc in wchar_t* std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::_S_construct<wchar_t const*>(wchar_t const*,
wchar_t const*, std::allocator<wchar_t> 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<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::basic_string(wchar_t const*,
std::allocator<wchar_t> 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<true,
0>::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::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::allocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>
>::_Rb_tree_base(std::allocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
> 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 <abort>)
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<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::_Rep::_S_create(unsigned, std::allocator<wchar_t>
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<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::_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<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::replace(std::__normal_iterator<wchar_t*,
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> > >,
std::__normal_iterator<wchar_t*,
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> > >, unsigned, wchar_t)
(this=0x4a9fde80, __i1=
{<iterator<std::random_access_iterator_tag,wchar_t,int,wchar_t*,wchar_t&>>
= {<No data fields>}, _M_current = 0x5eb7e294},
__i2=
{<iterator<std::random_access_iterator_tag,wchar_t,int,wchar_t*,wchar_t&>>
= {<No data fields>}, _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<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::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::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >,
std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>,
std::_Select1st<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>, std::less<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::allocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>
>::insert_unique(std::_Rb_tree_iterator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>&, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>*>, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
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::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >,
std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>,
std::_Select1st<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>, std::less<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::allocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
> >::_M_insert(std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*,
std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
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::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >,
std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>,
std::_Select1st<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>, std::less<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::allocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>
>::insert_unique(std::_Rb_tree_iterator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>&, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>*>, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
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::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >,
std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>,
std::_Select1st<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>, std::less<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::allocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
>
>::insert_unique(std::_Rb_tree_iterator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>&, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
>*>, std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >
const, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* libstdc++/10350: thread-safety problem in std::string.
@ 2003-04-08 16:16 jkanze
0 siblings, 0 replies; 4+ messages in thread
From: jkanze @ 2003-04-08 16:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 10350
>Category: libstdc++
>Synopsis: thread-safety problem in std::string.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Apr 08 16:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: James Kanze
>Release: g++ 3.2.2
>Organization:
>Environment:
>Description:
I believe I've found an error in the thread management in std::string in
the library. Basically, the problem occurs in the following context:
- There is a global variable declared:
std::string s ;
This variable is initialised by reading from a configuration file,
in main, before any threads have been initialized. It is non-const
so that this initialization can occur; it is never modified
afterwards. Since it is never modified once threads have been
started, no accesses are protected by mutex's or anything else.
- A copy of this variable is made to another string variable. This
causes the reference count _M_references in basic_string::_Rep to
become 1, with the result that _Rep::_M_is_shared will return true.
- Several threads are started. At exactly the same moment, in thread
A and thread B, an expression along the lines of "s[ i ] == 'x'" is
executed.
Note that because the instance is not const, the function called is
the non-const version of basic_string::operator[], even though
nobody is going to modify anything. (And because nobody is modifying
the string in any of the threads, there are no locks.) This function
begins by calling _M_leak; since _Rep isn't yet leaked, this
function calls _M_leak_hard, and since the _Rep is shared, we end up
in _M_mutate. _M_mutate, after calculating a lot of different sizes
(which aren't really relevant here), executes an if, which evaluates
true. The last two lines of the if are the critical section:
imagine that thread A has been executing up until now, and it is
interrupted by thread B. At this point, thread A has not modified
anything in the actual object -- it has made a series of tests,
decided that it must isolate the representation, and has prepared a
new representation, but it has not started installing it. Thread B
executes the same code, and since the actual object has not been
changed, comes to the same conclusions, and arrives at the same
point. From this point, several scenarios are possible: thread B
continues, calling dispose on the _Rep in the actual object (which,
since there is still another object using it, will not be
destructed), installs its own newly created _Rep and returns a
reference to the data in it. At this point, thread A takes over
again, calls _M_rep()->_M_dispose, which disposes of the _Rep
thread B has just installed -- since the just installed _Rep is not
shared it is deleted, and the reference in B is invalid.
For the moment, I'm not convinced that a copy on write implementation of
the std::string interface is possible with only the primitives
atomic_incr, atomic_decr, barrier_read and barrier_write -- the current
g++ implementation tries to do it with even less. (Note that the
current implementation fails lamentably in a multi-processor
environment; there is no effort what so ever made to ensure that writes
are actually seen by the other processes. But I've not much experience
in evaluating this sort of problem.)
Might I suggest that the current implementation be completely scrapped,
in favor of a simple deep copy. The results will be somewhat slower,
but at least they will work. Alternatively, if you have some mechanism
of switching implementations depending on the -mt switch of the
compiler... (I've found COW to be a definite win in my single threaded
applications.)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-05 11:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02 21:36 libstdc++/10350: thread-safety problem in std::string Fred Channey
-- strict thread matches above, loose matches on Subject: below --
2003-05-05 11:46 John Love-Jensen
2003-05-02 21:46 Fred Channey
2003-04-08 16:16 jkanze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).