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

Bug#445685: marked as done (Random uncatchable exceptions)



Your message dated Wed, 24 Oct 2007 09:56:15 -0700
with message-id <20071024165615.GA1267@alpaca>
and subject line Bug#445685: Acknowledgement (Random uncatchable exceptions)
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)

--- Begin Message ---
Package: g++-4.2
Version: 4.2.1-6
Severity: normal

  g++ seems to ignore exception handlers in unpredictable ways.  I've
attached a minimal program that illustrates what's been happening to me.
It aborts with an uncaught exception ("terminate called after throwing
an instance of 'exception'").  But if you comment out either the line
instantiating a class that crashes in its destructor, or the line that
explicitly throws an exception, the exception is caught as expected.

  Daniel

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages g++-4.2 depends on:
ii  gcc-4.2                       4.2.1-6    The GNU C compiler
ii  gcc-4.2-base                  4.2.1-6    The GNU Compiler Collection (base 
ii  libc6                         2.6.1-5    GNU C Library: Shared libraries
ii  libstdc++6-4.2-dev            4.2.1-6    The GNU Standard C++ Library v3 (d

g++-4.2 recommends no packages.

-- no debconf information
#include <iostream>

class exception
{
};

class crash_in_destructor
{
public:
  ~crash_in_destructor()
  {
    exception tmp;
    throw tmp;
  }
};

int main(int argc, char **argv)
{
  try
    {
      crash_in_destructor tmp;
      exception tmp2;
      throw tmp2;
    }
  catch(exception)
    {
      std::cout << "PASS" << std::endl;
      return 0;
    }

  std::cout << "FAIL" << std::endl;
  return -1;
}

--- End Message ---
--- Begin Message ---
On Sat, Oct 20, 2007 at 08:55:17AM +0200, Martin Michlmayr <tbm@cyrius.com> was heard to say:
> * Daniel Burrows <dburrows@debian.org> [2007-10-07 15:10]:
> > On further thought, it occurs to me that throwing an exception in a
> > destructor is a fundamentally nasty thing to do.  That may be the
> > root cause of the problem I ran into.
> 
> So do you want us to forward this issue to the GCC people or do you
> think it's simply user error?

  I think it's user stupidity -- reading around a little, it appears
that throwing from destructors is defined to lead to instant termination
in certain cases.

  Daniel


--- End Message ---

Reply to: