[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#295073: marked as done (g++-3.3: operator new doesn't initialize memory anymore after thrown exception)



Your message dated Sun, 13 Feb 2005 14:55:24 +0100
with message-id <87acq8d0oj.fsf@debian.org>
and subject line Bug#295073: g++-3.3: operator new doesn't initialize memory anymore after thrown exception
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 13 Feb 2005 13:25:43 +0000
>From f.b.brokken@rc.rug.nl Sun Feb 13 05:25:43 2005
Return-path: <f.b.brokken@rc.rug.nl>
Received: from oosix.icce.rug.nl [129.125.14.80] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1D0Jkt-0006C6-00; Sun, 13 Feb 2005 05:25:43 -0800
Received: from knarfix.oostum.north (knarfix.oostum.north [129.125.100.246])
	by oosix.icce.rug.nl (8.13.2/8.13.2/Debian-1) with ESMTP id j1DDPCvq031960
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 13 Feb 2005 14:25:12 +0100
Received: from knarfix.oostum.north (localhost [127.0.0.1])
	by knarfix.oostum.north (8.13.2/8.13.2/Debian-1) with ESMTP id j1DDP6br001529
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 13 Feb 2005 14:25:06 +0100
Received: (from frank@localhost)
	by knarfix.oostum.north (8.13.2/8.13.2/Submit) id j1DDP6A4001528;
	Sun, 13 Feb 2005 14:25:06 +0100
Message-Id: <[🔎] 200502131325.j1DDP6A4001528@knarfix.oostum.north>
X-Authentication-Warning: knarfix.oostum.north: frank set sender to f.b.brokken@rc.rug.nl using -f
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: "Frank B. Brokken" <f.b.brokken@rc.rug.nl>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: g++-3.3: operator new doesn't initialize memory anymore after thrown
 exception
X-Mailer: reportbug 3.2
Date: Sun, 13 Feb 2005 14:25:05 +0100
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: g++-3.3
Version: 1:3.3.5-5
Severity: normal


Dear g++ maintainer,

When running the following little program it appears that operator new fails
to initialize the memory it allocates. For example, when I run the program I
get the following output:

134517800 0 1074470752 1074986304 0 1 1 134517181 134517168 134515206 

The program was compiled using both a plain `g++' command and `g++ -Wall
-fexceptions'. No warnings are reported and compilation proceeds flawlessly. 

Here is the program;

------------------------------------------------
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

void showalloc()
{
    int *ip = new int [10];

    copy(ip, ip + 10, ostream_iterator<int>(cerr, " "));

    cout << endl;

    delete [] ip;
}

void thrower()
{
    try
    {
        throw 0;    // remove this to obtain memory initialized to 0
    }
    catch(...)
    {}
}

int main()
{
    thrower();
    showalloc();
    return 0;
}
------------------------------------------------

When the `throw 0;' statement is removed the memory comes out neatly
initialized. The program's output in that case is:

0 0 0 0 0 0 0 0 0 0 

Kind regards,

Frank B. Brokken

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8.1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages g++-3.3 depends on:
ii  gcc-3.3                     1:3.3.5-5    The GNU C compiler
ii  gcc-3.3-base                1:3.3.5-5    The GNU Compiler Collection (base 
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libstdc++5-3.3-dev          1:3.3.5-5    The GNU Standard C++ Library v3 (d

-- no debconf information

---------------------------------------
Received: (at 295073-done) by bugs.debian.org; 13 Feb 2005 13:55:57 +0000
>From falk@debian.org Sun Feb 13 05:55:56 2005
Return-path: <falk@debian.org>
Received: from smtp07.web.de [217.72.192.225] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1D0KE8-0001ml-00; Sun, 13 Feb 2005 05:55:56 -0800
Received: from [80.144.178.220] (helo=juist)
	by smtp07.web.de with asmtp (TLSv1:DES-CBC3-SHA:168)
	(WEB.DE 4.103 #192)
	id 1D0KDd-00045r-00
	for 295073-done@bugs.debian.org; Sun, 13 Feb 2005 14:55:26 +0100
Received: from falk by juist with local (Exim 4.44)
	id 1D0KDc-0000la-43
	for 295073-done@bugs.debian.org; Sun, 13 Feb 2005 14:55:24 +0100
To: 295073-done@bugs.debian.org
Subject: Re: Bug#295073: g++-3.3: operator new doesn't initialize memory
 anymore after thrown exception
References: <[🔎] 200502131325.j1DDP6A4001528@knarfix.oostum.north>
From: Falk Hueffner <falk@debian.org>
X-Face: "iUeUu$b*W_"w?tV83Y3*r:`rh&dRv}$YnZ3,LVeCZSYVuf[Gpo*5%_=/\_!gc_,SS}[~xZ
 wY77I-M)xHIx:2f56g%/`SOw"Dx%4Xq0&f\Tj~>|QR|vGlU}TBYhiG(K:2<T^
Date: Sun, 13 Feb 2005 14:55:24 +0100
In-Reply-To: <[🔎] 200502131325.j1DDP6A4001528@knarfix.oostum.north> (Frank B.
 Brokken's message of "Sun, 13 Feb 2005 14:25:05 +0100")
Message-ID: <87acq8d0oj.fsf@debian.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (cabbage, linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: falk@debian.org
X-Sender: falk.hueffner@web.de
Delivered-To: 295073-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-4.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
	RCVD_IN_DSBL autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

"Frank B. Brokken" <f.b.brokken@rc.rug.nl> writes:

> When running the following little program it appears that operator
> new fails to initialize the memory it allocates.

That's as expected, "new" for POD types does not initialize the data
(5.3.4/15).

-- 
	Falk



Reply to: