Re: Problem with noexcept and incomplete backtrace

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

 



On 08/01/13 17:47, Tobias Ringström wrote:
> I've discovered a problem with backtraces when using noexcept, but I
> don't know if it's a bug, required behaviour, or if I'm missing
> something.  I'd appreciate a little guidance.
>
> The problem is that when an exception is thrown and there's a
> "noexcept" function earlier in the call stack, the backtrace is
> sometimes incomplete, i.e. it ends before the throw location.
> Specifically, it seems to end at the first function above the
> "noexcept" function that has an object with a destructor in it.
>
> It's probably easier to understand with an example:
(...)
> As you can see, bad_guy is not in the backtrace.
>
> There are two simple modifications that makes the backtrace complete.
> The first is to remove the noexcept from level1, and the second is to
> remove the Foo declaration in level2 (or delete Foo's destructor).  I
> really need the noexcept because in my real application, level1 is a
> thread main function, which needs the noexcept, or I don't any call
> stack below libstdc++'s thread caller, because it has a try/catch all
> block to call terminate.
>
> Should I file a bug report?  I've tested 4.6.3, 4.7.2 and
> 4.8-20130106, with identical results.
>
> /Tobias
You are lying to the compiler there. OTOH, level1 shall not throw any
exception (has noexcept), OTOH it *is* throwing an exception. So I gues
you're at undefined behavior.
What about surrounding the content of level with a try catch all ?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux