public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length.
@ 2004-02-17 14:14 nivelle at mpi-sb dot mpg dot de
  2004-02-17 14:27 ` [Bug libstdc++/14176] " pcarlini at suse dot de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nivelle at mpi-sb dot mpg dot de @ 2004-02-17 14:14 UTC (permalink / raw)
  To: gcc-bugs

Hello,

I am not certain what the standard says about this, but the following code
causes a segmentation fault under various versions of g++ .
It is a bit strange off course to allocate segments of length 0, but
for symmetry it makes sense to allow it.

yours,
Hans.


#include <memory>

int main( int argc, char * argv[] )
{

   unsigned int len = 0;

   std::allocator< int > a;
   int* p = a. allocate( len );
   a. deallocate( p, len );

};

-- 
           Summary: standard allocator crashes when deallocating segment of
                    zero length.
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nivelle at mpi-sb dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/14176] standard allocator crashes when deallocating segment of zero length.
  2004-02-17 14:14 [Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length nivelle at mpi-sb dot mpg dot de
@ 2004-02-17 14:27 ` pcarlini at suse dot de
  2004-02-17 16:21 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pcarlini at suse dot de @ 2004-02-17 14:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/14176] standard allocator crashes when deallocating segment of zero length.
  2004-02-17 14:14 [Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length nivelle at mpi-sb dot mpg dot de
  2004-02-17 14:27 ` [Bug libstdc++/14176] " pcarlini at suse dot de
@ 2004-02-17 16:21 ` pinskia at gcc dot gnu dot org
  2004-03-18 20:46 ` bkoz at gcc dot gnu dot org
  2004-03-20 11:17 ` steven at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-17 16:21 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |2.95.3 3.0.4 3.2.2 3.2.3
                   |                            |3.3.1
      Known to work|                            |3.5.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/14176] standard allocator crashes when deallocating segment of zero length.
  2004-02-17 14:14 [Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length nivelle at mpi-sb dot mpg dot de
  2004-02-17 14:27 ` [Bug libstdc++/14176] " pcarlini at suse dot de
  2004-02-17 16:21 ` pinskia at gcc dot gnu dot org
@ 2004-03-18 20:46 ` bkoz at gcc dot gnu dot org
  2004-03-20 11:17 ` steven at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-03-18 20:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-03-18 20:46 -------

This is fixed in 3.4.0, and a testsuite added to prevent it from resurfacing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/14176] standard allocator crashes when deallocating segment of zero length.
  2004-02-17 14:14 [Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length nivelle at mpi-sb dot mpg dot de
                   ` (2 preceding siblings ...)
  2004-03-18 20:46 ` bkoz at gcc dot gnu dot org
@ 2004-03-20 11:17 ` steven at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-03-20 11:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-03-20 11:17 -------
Fixed in 3.4.0 according to Benjamin Kosnik, so I'm closing it. 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at gcc dot gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|3.4.0                       |3.3.4


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-20 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17 14:14 [Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length nivelle at mpi-sb dot mpg dot de
2004-02-17 14:27 ` [Bug libstdc++/14176] " pcarlini at suse dot de
2004-02-17 16:21 ` pinskia at gcc dot gnu dot org
2004-03-18 20:46 ` bkoz at gcc dot gnu dot org
2004-03-20 11:17 ` steven at gcc dot gnu dot org

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