public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* std::string:;assign fail in multi-threaded program
@ 2005-08-01  2:58 Suet Lung Cheung
  0 siblings, 0 replies; only message in thread
From: Suet Lung Cheung @ 2005-08-01  2:58 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=big5, Size: 2324 bytes --]

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


_______________________________________
 ·Q§Y®É¦¬¨ì·s email ³qª¾¡H
 ¤U¸ü Yahoo! Messenger http://messenger.yahoo.com.hk 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-01  2:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-01  2:58 std::string:;assign fail in multi-threaded program Suet Lung Cheung

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).