Closed geraschenko closed 7 years ago
Thanks for the issue, and the PR. I prefer to address the actual issue, so I had a look at the signal handlers (needed doing anyway as there are a few reports of issues with it). The main problem that I see with them is that the handlers abort, rather than calling the original handler again. So I've changed it to do that instead and, in my testing, your issue seems to have gone away. It's currently on a branch (signals). If you get a chance could you please verify against:
https://raw.githubusercontent.com/philsquared/Catch/signals/single_include/catch.hpp
And let me know that it fixes it for you too?
This fixes the issue for me. Thanks!
Cool, thanks for letting me know. I'm probably not going to merge this branch in as is because @horenmar has a more comprehensive one (that includes much the same fix - plus more) nearly ready to merge instead. I'm 99% sure it will be just as effective here.
This should be fixed in branch dev-signals
. Do note that the single-include header there is not regenerated, so if you want to test it, you have to regenerate it yourself (just run generateSingleHeader.py
in scripts
folder).
Output on my PC is now
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.out is a Catch v1.6.0 host application.
Run with -? for options
-------------------------------------------------------------------------------
killcatch
-------------------------------------------------------------------------------
sig1.cpp:7
...............................................................................
sig1.cpp:7: FAILED:
due to a fatal error condition:
SIGABRT - Abort (abnormal termination) signal
===============================================================================
test cases: 1 | 1 failed
assertions: 1 | 1 failed
Aborted (core dumped)
which is what it should be.
Since the signals
branch has been merged into dev-signals
and dev-signals
has been merged back to master, I am going to close this.
I don't completely understand what makes this bug tick, but the Colour struct can sometimes call std::terminate() recursively. Here's a small example:
When I run this, I get a long string of
Here's the recursive bit of the stack when this happens: