-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested sections when REQUIRE_THROWS_WITH is used are not traversed correctly on clang+FreeBSD #1028
Comments
Without further investigation, I won't say that it is this, but it does look a bit familiar. |
That's exactly the issue. I just tried to throw the exception "another way", replacing the throw call with |
@rkaminsk Do you mean in the exception translators? If that solves it, it is worth it even though it is just working around a runtime bug. However, I don't have access to any machine where this bug reproduces, so I need someone else to test it. |
I experimented a bit. Basically, what fails is #include <stdexcept>
#include <cassert>
int main() {
try {
throw std::runtime_error("test");
}
catch (...) {
try {
throw;
}
catch (...) {
}
}
assert (!std::uncaught_exception());
} Changing this to #include <stdexcept>
#include <cassert>
int main() {
try {
throw std::runtime_error("test");
}
catch (...) {
try {
std::rethrow_exception(std::current_exception());
}
catch (...) {
}
}
assert (!std::uncaught_exception());
} works as expected. Also, this should work on any platform with C++11 support. The change to catch should be simple: just replace all calls to throw. I can test this for you if you like. (I am running FreeBSD in VirtualBox. It just takes a couple of minutes to install and the compiler is part of the default installation.) |
That looks interesting. The attached single include replaces all |
Using the modified version reduced the number of test failures I got. Interestingly, the project I was testing with also uses Update 1: Out of curiosity I build clang's libcxx so that it uses libcxxrt (instead of llvm's libcxxabi or gcc's libsupc++). With this setup I can reproduce the errors on my gentoo linux box. Update 2: I reported the issue with libcxxrt pathscale/libcxxrt#49. Let's see what they say. |
Hi, I just checked, commit pathscale/libcxxrt@6f4cfa28c42b71cdff570f69ed523ab45d4245be fixes the issue. |
I committed the changes anyway, as there will likely be boxes with the old version for the foreseeable future anyway. |
@rkaminsk does this address the issue for you? |
Hi, like I said the pach fixes some of my test cases on FreeBSD. This is a libcxxrt bug, not a catch bug. Up to you if you want to apply this. |
It is actually applied in Catch 2, because there is a good chance we will be working against bugged libcxxrt in the wild for quite some time. |
Description
The following program does not execute correctly on freebsd with catch v2.0.0-develop.4:
It produces the output:
When uncommenting the
REQUIRE_THROWS_WITH
it correctly produces:Interestingly, with catch 1.9.6 the same issue can also be triggered with the first
REQUIRE_THROWS
but not with catch 2.0.0-develop.4. Was an issue with this already addressed before?Extra information
The text was updated successfully, but these errors were encountered: