This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
std::string:;assign fail in multi-threaded program
- From: Suet Lung Cheung <suetlung2003 at yahoo dot com dot hk>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 1 Aug 2005 10:58:09 +0800 (CST)
- Subject: std::string:;assign fail in multi-threaded program
Hi,
First, thx for u all reading this mail. I have some
problems when I was using std::string when I was
writing my multi-threaded server. I am using libstdc++
5.0.3. and using pthread to do multi threading. The
errors are as the followings.
shot 1
#0 0xbfdb3bc6 in std::__default_alloc_template<true,
0>::allocate(unsigned) ()
from /usr/lib/libstdc++.so.5
(gdb) bt
#0 0xbfdb3bc6 in std::__default_alloc_template<true,
0>::allocate(unsigned) ()
from /usr/lib/libstdc++.so.5
#1 0xbfdb9bf8 in
std::string::_Rep::_S_create(unsigned,
std::allocator<char> const&) () from
/usr/lib/libstdc++.so.5
#2 0xbfdb641d in std::string::_M_mutate(unsigned,
unsigned, unsigned) ()
from /usr/lib/libstdc++.so.5
#3 0x08066f8d in std::string&
std::string::_M_replace_safe<char
const*>(__gnu_cxx::__normal_iterator<char*,
std::string>, __gnu_cxx::__normal_iterator<char*,
std::string>, char const*, char const*)
(this=0xbd3d6bd0,
__k1=0xbf8b3349 "kent", __k2=0xbf8b334d "") at
basic_string.tcc:533
#4 0xbfdb6fac in std::string::assign(char const*,
unsigned) ()
from /usr/lib/libstdc++.so.5
snap 2#0 0xbffabc32 in _dl_sysinfo_int80 () from
/lib/ld-linux.so.2
#1 0xbfbffa29 in raise () from /lib/tls/libc.so.6
#2 0xbfc01255 in abort () from /lib/tls/libc.so.6
#3 0xbfdc7537 in __cxa_call_unexpected () from
/usr/lib/libstdc++.so.5
#4 0xbfdc7584 in std::terminate() () from
/usr/lib/libstdc++.so.5
#5 0xbfdc76f6 in __cxa_throw () from
/usr/lib/libstdc++.so.5
#6 0xbfd80ebb in std::__throw_length_error(char
const*) ()
from /usr/lib/libstdc++.so.5
#7 0xbfdb9c25 in
std::string::_Rep::_S_create(unsigned,
std::allocator<char> const&) () from
/usr/lib/libstdc++.so.5
#8 0xbfdb9d29 in
std::string::_Rep::_M_clone(std::allocator<char>
const&, unsigned) () from /usr/lib/libstdc++.so.5
#9 0xbfdb678d in
std::string::_Rep::_M_grab(std::allocator<char>
const&, std::allocator<char> const&) () from
/usr/lib/libstdc++.so.5
#10 0xbfdb8133 in std::string::assign(std::string
const&) ()
from /usr/lib/libstdc++.so.5
I would like to ask what is the possible reason of
these errors? I am using a dual Xeon CPU as my server.
Is it related to this issue? Thanks a lot.
Snow Dragon
_______________________________________
想即時收到新 email 通知?
下載 Yahoo! Messenger http://messenger.yahoo.com.hk