| Title: | Alpha Developer Support |
| Notice: | [email protected], 800-332-4786 |
| Moderator: | HYDRA::SYSTEM |
| Created: | Mon Jun 06 1994 |
| Last Modified: | Fri Jun 06 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 3722 |
| Total number of notes: | 11359 |
Company Name : iona software
Contact Name : John Morrow
Phone : 00353 1 6625255
Fax : 00353 1 6625244
Email : [email protected]
Date/Time in : 11-FEB-1997 15:57:34
Entered by : Nick Hudson
SPE center : REO
Category : UNIX
OS Version : 4
System H/W : Alpha
Brief Description of Problem:
-----------------------------
From: WATNOW::"[email protected]" 11-FEB-1997 15:42:33.70
To: [email protected]
CC: [email protected], [email protected]
Subj: Problem with exceptions in destructors.
Hi Nick,
I'm compiling some C++ code on Digital UNIX 4.0 and am getting a problem with
exceptions in distructors. The problem is that when the destructor is called
and throws an exception, all the local objects are destructed twice, causing
the heap to become corrupted.
If you run this test program.....
---------------------------------------------------------
#include <iostream.h>
class EnvExcRaiser {
public:
EnvExcRaiser () { cout << "Default CTR EnvExcRaiser " << endl; }
~EnvExcRaiser () { cout << "Default DTR EnvExcRaiser " << endl; throw 0; }
};
class account {
public:
account () { cout << "Default CTR account " << (void*)this << endl; }
~account () { cout << "Default DTR account " << (void*)this << endl; }
};
int fun()
{
EnvExcRaiser ex;
account accountPtr;
return 0;
}
int main()
{
try {
fun();
}
catch (...) {
cout << "Exception raised" << endl;
}
return 0;
}
---------------------------------------------------------
...... it gives the following output.
Default CTR EnvExcRaiser
Default CTR account 0x11ffff7d0
Default DTR account 0x11ffff7d0
Default DTR EnvExcRaiser
Default DTR account 0x11ffff7d0
Default DTR EnvExcRaiser
IOT/Abort trap (core dumped)
Is there a fix available for this?
uname -a
OSF1 behemoth V4.0 464 alpha
Thanks in advance,
John.
_______________________________
John Morrow
Iona Technologies Ltd.,
8-10 Pembroke Street,
Dublin 2.
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 3181.1 | entered C++ note 3444 | KZIN::HUDSON | That's what I think | Tue Feb 11 1997 11:25 | 20 |
From: DEC:.REO.REOVTX::HUDSON "[email protected] - UK Software Partner Engineering 830-4121" 11-FEB-1997 16:25:21.88 To: nm%vbormc::"[email protected]" CC: HUDSON Subj: RE: Problem with exceptions in destructors. Hello John So far as I can see this is incorrect behaviour, so I've reported it to the C++ engineering group; I'll let you know what they say. Incidentally, it's better if you go through the ASAP route when logging new problems: it means that they can track calls more easily, and also means that they will pass the problem on to someone who is around. If I'm not here and you send mail direct to me then it may go unanswered. Regards Nick Hudson Digital Software Partner Engineering | |||||
| 3181.2 | KZIN::HUDSON | That's what I think | Thu Feb 13 1997 06:26 | 37 | |
From: VBORMC::"[email protected]" "John Morrow" 13-FEB-1997 09:37:48.64 To: "[email protected] - UK Software Partner Engineering 830-4121 11-Feb-1997 1625 +0000" <[email protected]> CC: [email protected], [email protected] Subj: Re: Problem with exceptions in destructors. Hi Nick, Just to let you know, we also have the same problem with exceptions in distructors on openVMS (alpha) v7.1 using C++ compiler v5.4-010. Thanks, John. % ====== Internet headers and postmarks (see DECWRL::GATEWAY.DOC) ====== % Received: from mail.vbo.dec.com (mail.vbo.dec.com [16.36.208.34]) by vbormc.vbo.dec.com (8.7.3/8.7) with ESMTP id KAA26655 for <[email protected]>; Thu, 13 Feb 1997 10:34:28 +0100 % Received: from server21.digital.fr (server21.digital.fr [193.56.15.21]) by mail.vbo.dec.com (8.7.3/8.7) with ESMTP id KAA26723 for <[email protected]>; Thu, 13 Feb 1997 10:39:14 +0100 (MET) % Received: from dublin.iona.ie (operation.dublin.iona.ie [192.122.221.5]) by server21.digital.fr (8.7.5/8.7) with ESMTP id KAA19170 for <[email protected]>; Thu, 13 Feb 1997 10:41:25 +0100 (MET) % Received: from ultra (ultra [192.122.221.136]) by dublin.iona.ie (8.7.5/jm-1.01) with ESMTP id JAA10462; Thu, 13 Feb 1997 09:16:06 GMT % Message-Id: <[email protected]> % X-Mailer: exmh version 1.6.6 3/24/96 % To: "[email protected] - UK Software Partner Engineering 830-4121 11-Feb-1997 1625 +0000" <[email protected] % cc: [email protected], [email protected] % Subject: Re: Problem with exceptions in destructors. % Mime-Version: 1.0 % Content-Type: text/plain; charset=us-ascii % Date: Thu, 13 Feb 1997 09:22:24 +0000 % From: John Morrow <[email protected]> | |||||