Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Destructor called twice.

15 views
Skip to first unread message

Theo Lindebaum

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
Hi all,

I working with a multi-threaded Win32 console application, where I am
using a set of classes to implement an I/O software layer. I have found
that under certain circumstances, if I throw an exception, a certain
destructor is called twice during the stack unwinding procedure of the
exception handling. I've tried compiling the application with both
Borland C++ 5.02 and C++Builder 1.0, and have the same results. (The
application is being run under windows NT 4.0). Using the debugger, I
have verified that both calls to the destructor in question occur during
the stack unwinding mechanism.

Are there any known problems with the destructors during exception
handling with the Borland compilers? If yes, are there fixes for these?

PS: As a test, I recompiled with Visual C++ 6.0, and Watcom C++ 10.6,
and neither of these versions exhibited the double call of the
destructor, and work as expected.

Theo Lindebaum

vcard.vcf

Jody Hagins (TeamB)

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
On Tue, 04 Apr 2000 15:00:45 +0200, Theo Lindebaum <t.lin...@wavecom.ch>
wrote:


>Are there any known problems with the destructors during exception
>handling with the Borland compilers? If yes, are there fixes for these?


Exceptions are very broken in pre BCB4 versions.


---
Happy Building!
Jody
http://www.hagins.com

"The speed of light just ain't what it used to be." -- Jonathan Butler

Theo Lindebaum

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
Dear Jody,

Thanks for the tip!

I shall now wait for the BCB 5.0 I've already ordered ...

Hooray for the return of CodeGuard!

Igor T.

unread,
Apr 4, 2000, 3:00:00 AM4/4/00
to
To be correct, exceptions are very broken in BC5.02 but they
are quite fine in BC 5.01.

--
Best regards,
Igor.
---
itereshchenkoATcccglobalDOTcom

"Jody Hagins (TeamB)" <jo...@atdesk.com> wrote in message
news:38ea0570....@forums.borland.com...

Theo Lindebaum

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to

Igor T. wrote:

> To be correct, exceptions are very broken in BC5.02 but they
> are quite fine in BC 5.01.
>
> --
> Best regards,
> Igor.
> ---

Thanks for the info, Igor.

Hey Borland! Why has this not been fixed in a service pack then?!


Matt A.

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
"Theo Lindebaum" <t.lin...@wavecom.ch> wrote in message
news:38EAFF82...@wavecom.ch...

>
>
> Igor T. wrote:
>
> > To be correct, exceptions are very broken in BC5.02 but they
> > are quite fine in BC 5.01.

[snip]

> Thanks for the info, Igor.
>
> Hey Borland! Why has this not been fixed in a service pack then?!

The Borland C++ line is discontinued. The last version, 5.02, was released
back in 1997. Borland released one patch for the final version
(http://www.borland.com/devsupport/borlandcpp/patches/bc52p1.exe) but the
product is no longer being actively developed.

Borland's current C++ compiler is C++Builder 5.0. For details, visit
http://www.borland.com/bcppbuilder/.

Also, the command-line versions of C++Builder 5.0's compiler and tools are
being given away free as "Borland C++ 5.5" (although the release has little
in common with any previous "Borland C++ 5.x" version, there's no IDE, no
debugger, etc.). For details, visit
http://www.borland.com/bcppbuilder/freecompiler/.

Note that some creative people have developed an AddOn called "Tools 5.5"
that allows you to use the new compiler with it with the 5.x IDE. Check it
out at http://nextera.sirma.bg/knowledgebase/.

- Matt


Theo Lindebaum

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to

Matt A. wrote:

> "Theo Lindebaum" <t.lin...@wavecom.ch> wrote in message
> news:38EAFF82...@wavecom.ch...
> >
> >
> > Igor T. wrote:
> >
> > > To be correct, exceptions are very broken in BC5.02 but they
> > > are quite fine in BC 5.01.
>
> [snip]
>
> > Thanks for the info, Igor.
> >
> > Hey Borland! Why has this not been fixed in a service pack then?!
>
> The Borland C++ line is discontinued. The last version, 5.02, was released
> back in 1997. Borland released one patch for the final version
> (http://www.borland.com/devsupport/borlandcpp/patches/bc52p1.exe) but the
> product is no longer being actively developed.
>

[snip]

That's no excuse for not fixing known problems. Broken exception handling is
not exactly a minor problem. And besides, BCB 5, it was bundled with previous
versions of BCB.

Theo


Jody Hagins (TeamB)

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
On Thu, 06 Apr 2000 17:06:18 +0200, Theo Lindebaum <t.lin...@wavecom.ch>
wrote:


>That's no excuse for not fixing known problems. Broken exception handling is
>not exactly a minor problem. And besides, BCB 5, it was bundled with previous
>versions of BCB.

Do not confuse the old borland compiler versions with the new BCB ones (even
though the version numbers seem to coincide here).

Exception handling was given lots of time and improvement in BCB4, and
should be even better in BCB5.

Theo Lindebaum

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
Jody Hagins (TeamB) wrote:

> >That's no excuse for not fixing known problems. Broken exception handling is
> >not exactly a minor problem. And besides, BCB 5, it was bundled with previous
> >versions of BCB.
>
> Do not confuse the old borland compiler versions with the new BCB ones (even
> though the version numbers seem to coincide here).
>
> Exception handling was given lots of time and improvement in BCB4, and
> should be even better in BCB5.

Thanks for replying.

I know all this. You missed the point. Exception handling problems are a
fundamental part of the compiler, and so I think it fair enough to expect that the
problems be fixed. This is not a "new feature", but only fixing a failing in the
implementation. And so I should not be expected to buy a new version to fix the
problem. Although (sadly) one expects software products to ship with defects, it
is fair enough to expect that know problems will be fixed, so that at the end of
the day you indeed have a product that lives up to it's marketing promises. After
all, that is what I paid for.

I like using the BC5.02 IDE and compiler - the IDE is lightweight (by todays
standards), and the compiler familiar and productive (at least until I started
using exceptions in a big way).


Jerry Bloomfield (TeamB)

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
On Fri, 07 Apr 2000 09:11:01 +0200, Theo Lindebaum <t.lin...@wavecom.ch>
wrote:

>Although (sadly) one expects software products to ship with defects, it


>is fair enough to expect that know problems will be fixed, so that at the end of
>the day you indeed have a product that lives up to it's marketing promises. After
>all, that is what I paid for.

Forgive the bad analogy here, but isn't this like expecting your local
Ford dealer to have the replacement parts in stock for your "Model A" Ford?
After all, it was marketed that you just go back to the dealer to get the
replacement parts should one wear-out or fail...

I know it is a bad analogy, but essentially you are asking for this by
wanting updates to a product which was discontinued a long time ago (in
relative terms).

Jerry Bloomfield (TeamB)
--
http://www.teamb.com Jers...@wwa.com
Please do *NOT* send private e-mail without prior permission (my anti-spam filters will probably just delete it anyway <g>)

Matt A.

unread,
Apr 9, 2000, 3:00:00 AM4/9/00
to
"Jerry Bloomfield (TeamB)" <Jers...@wwa.com> wrote in message
news:fu8tes4id1r1gi3na...@4ax.com...

> On Fri, 07 Apr 2000 09:11:01 +0200, Theo Lindebaum
<t.lin...@wavecom.ch>
> wrote:
>
> >Although (sadly) one expects software products to ship with defects, it
> >is fair enough to expect that know problems will be fixed, so that at the
end of

[snip]


> Forgive the bad analogy here, but isn't this like expecting your local
> Ford dealer to have the replacement parts in stock for your "Model A"
Ford?

[snip]


> essentially you are asking for this by
> wanting updates to a product which was discontinued a long time ago (in
> relative terms).

I realize you say yourself this it's a bad analogy, but one major difference
between a Model A and Borland C++ is that -- in relative terms -- many
people are still "driving" Borland C++ around (presumably version 5.x).
Borland's own measurements reveal this at
http://www.borland.com/bcppbuilder/survey/surveyresults.html.

- Matt


Theo Lindebaum

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to

Jerry Bloomfield (TeamB) wrote:

> On Fri, 07 Apr 2000 09:11:01 +0200, Theo Lindebaum <t.lin...@wavecom.ch>
> wrote:
>
> >Although (sadly) one expects software products to ship with defects, it
> >is fair enough to expect that know problems will be fixed, so that at the end of

> >the day you indeed have a product that lives up to it's marketing promises. After
> >all, that is what I paid for.
>

> Forgive the bad analogy here, but isn't this like expecting your local
> Ford dealer to have the replacement parts in stock for your "Model A" Ford?

> After all, it was marketed that you just go back to the dealer to get the
> replacement parts should one wear-out or fail...
>

> I know it is a bad analogy, but essentially you are asking for this by


> wanting updates to a product which was discontinued a long time ago (in
> relative terms).
>

[snip]

Considering that BC 5.02 was still bundled with BCB 4.0, one can hardly say that BC 5.02 was discontinued a long time ago.
When was the BC++ Y2K patch released? No so long ago.

And besides that, the exception handling problem should have been fixed a long time ago. After all, how can a self respecting
C++ compiler leave known bugs in exception handling which is a core feature of C++.

If I did own an older model car, that failed at some in-opportune moment, due to a known defect in the car that the
manufacturer neglected to correct (and not just normal wear and tear), I would be demanding that the situation be rectified.

Like I said before, at the end of the day, I believe that the paying consumer has a right to expect known problems in software
be rectified. Software companies very seldom offer free upgrades to fix problems. If they did, that would be less than ideal
anyway, since most often the new software version comes with a whole new set of problems anyway, taking you back to square
one. (Look at the Win95a problems with the BC 5.5 command line tools ...).

Please Borland - just fix the exception handling in Borland C++ 5.02 ! Your customers deserve that.

0 new messages