public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Suet Lung Cheung <suetlung2003@yahoo.com.hk>
To: gcc@gcc.gnu.org
Subject: std::string:;assign fail in multi-threaded program
Date: Mon, 01 Aug 2005 02:58:00 -0000	[thread overview]
Message-ID: <20050801025809.23235.qmail@web51902.mail.yahoo.com> (raw)

[-- 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 

                 reply	other threads:[~2005-08-01  2:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050801025809.23235.qmail@web51902.mail.yahoo.com \
    --to=suetlung2003@yahoo.com.hk \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).