public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bkoz at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/32284]  New: empty std::string w/ _GLIBCXX_FULLY_DYNAMIC_STRING faults
Date: Mon, 11 Jun 2007 14:22:00 -0000	[thread overview]
Message-ID: <bug-32284-365@http.gcc.gnu.org/bugzilla/> (raw)

This is a regression post 3.4.6. 

gcc-4.1.x, gcc-4.2.x, gcc-4.3.x all have it. 

ie: 

// $ c++ -O -D_GLIBCXX_FULLY_DYNAMIC_STRING str.cc -o str
#include <string>

int main()
{
  std::string abc;  
  return 0;
}


gives:

*** glibc detected *** ./a.out: free(): invalid pointer: 0xb7f3c678 ***
======= Backtrace: =========
/lib/libc.so.6[0x4a92f9ad]
/lib/libc.so.6(cfree+0x90)[0x4a933000]
/mnt/share/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6(_ZdlPv+0x21)[0xb7f0c2e1]
/mnt/share/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d)[0xb7eea51d]
./a.out(__gxx_personality_v0+0x18d)[0x80486d9]
/lib/libc.so.6(__libc_start_main+0xdc)[0x4a8dedec]
./a.out(__gxx_personality_v0+0x65)[0x80485b1]
======= Memory map: ========
08048000-08049000 r-xp 00000000 fd:00 59605146   /home/bkoz/a.out
08049000-0804a000 rw-p 00000000 fd:00 59605146   /home/bkoz/a.out
0804a000-0806b000 rw-p 0804a000 00:00 0          [heap]
4a8ac000-4a8c5000 r-xp 00000000 fd:00 33917325   /lib/ld-2.5.so
4a8c5000-4a8c6000 r--p 00018000 fd:00 33917325   /lib/ld-2.5.so
4a8c6000-4a8c7000 rw-p 00019000 fd:00 33917325   /lib/ld-2.5.so
4a8c9000-4aa02000 r-xp 00000000 fd:00 33917354   /lib/libc-2.5.so
4aa02000-4aa04000 r--p 00139000 fd:00 33917354   /lib/libc-2.5.so
4aa04000-4aa05000 rw-p 0013b000 fd:00 33917354   /lib/libc-2.5.so
4aa05000-4aa08000 rw-p 4aa05000 00:00 0 
4aa0a000-4aa2f000 r-xp 00000000 fd:00 33917357   /lib/libm-2.5.so
4aa2f000-4aa30000 r--p 00024000 fd:00 33917357   /lib/libm-2.5.so
4aa30000-4aa31000 rw-p 00025000 fd:00 33917357   /lib/libm-2.5.so
b7e38000-b7e3a000 rw-p b7e38000 00:00 0 
b7e3a000-b7e44000 r-xp 00000000 fd:00 51258449  
/mnt/share/bld/gcc/gcc/libgcc_s.so.1
b7e44000-b7e45000 rw-p 00009000 fd:00 51258449  
/mnt/share/bld/gcc/gcc/libgcc_s.so.1
b7e5d000-b7f36000 r-xp 00000000 fd:00 5210259   
/mnt/share/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.9
b7f36000-b7f3a000 r--p 000d9000 fd:00 5210259   
/mnt/share/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.9
b7f3a000-b7f3b000 rw-p 000dd000 fd:00 5210259   
/mnt/share/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.9
b7f3b000-b7f42000 rw-p b7f3b000 00:00 0 
b7f42000-b7f43000 r-xp b7f42000 00:00 0          [vdso]
bfc74000-bfc8a000 rw-p bfc74000 00:00 0          [stack]
Abort


Fixing this is relatively easy, just forward-porting the changes to
std::string::_Rep::_M_destroy that were taken out.

See attached patch.


-- 
           Summary: empty std::string w/ _GLIBCXX_FULLY_DYNAMIC_STRING
                    faults
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkoz at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32284


             reply	other threads:[~2007-06-11 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 14:22 bkoz at gcc dot gnu dot org [this message]
2007-06-11 14:23 ` [Bug libstdc++/32284] " bkoz at gcc dot gnu dot org
2007-06-11 15:26 ` pcarlini at suse dot de
2007-06-23 11:33 ` pcarlini at suse dot de

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=bug-32284-365@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).