This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/517: New causes seg fault while malloc correctly return null
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/517: New causes seg fault while malloc correctly return null
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: 8 Sep 2000 16:56:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Phil Edwards <pedwards at disaster dot jaj dot com>
The following reply was made to PR c++/517; it has been noted by GNATS.
From: Phil Edwards <pedwards@disaster.jaj.com>
To: jdrrun@gte.net
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/517: New causes seg fault while malloc correctly return null
Date: Fri, 8 Sep 2000 12:58:15 -0400
On Fri, Sep 08, 2000 at 04:33:57PM -0000, jdrrun@gte.net wrote:
> >Environment:
> Redhat linux 6.1, Redhat linux 6.2, Mandrake 6.0
You didn't mention which version of the compiler you're using. I don't
have any of those three distros handy, but I'm assuming they're 2.95.x.
> >Fix:
> correct implementaion of new so that it returns std::bad_alloc or a null pointer.
This works fine (well, a bad_alloc is thrown) with a more recent compiler
snapshot and a libstdc++-v3 snapshot.
Also, I have to set a shell process resource limit on the heap size before
you'll see a failure; I suspect you already have such a limit.
Phil