From c4901206cff33e5e1eae76684a9d8f416df29af5 Mon Sep 17 00:00:00 2001 From: Charles Wilson Date: Sat, 19 Jun 2010 16:29:45 -0400 Subject: [PATCH] [cygwin] Fix segfault in C++ exception handling test * tests/exceptions.at (main.cpp:exceptions_in_module): Move dlclose outside catch block; otherwise __cxa_end_catch (part of the cygwin g++ ABI) accesses pointers to data inside unloaded DLL. This is a platform ABI-specific bug, but is likely common to many platforms' g++ and/or other C++ compilers. Signed-off-by: Charles Wilson --- ChangeLog | 10 ++++++++++ tests/exceptions.at | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index ae3790698..17a140675 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-06-19 Charles Wilson + + [cygwin] Fix segfault in C++ exception handling test + * tests/exceptions.at (main.cpp:exceptions_in_module): + Move dlclose outside catch block; otherwise __cxa_end_catch + (part of the cygwin g++ ABI) accesses pointers to data inside + unloaded DLL. This is a platform ABI-specific bug, but is + likely common to many platforms' g++ and/or other C++ + compilers. + 2010-06-19 Ralf Wildenhues Fix srcdir computation for manual runs of old tests. diff --git a/tests/exceptions.at b/tests/exceptions.at index 293723c77..23442a356 100644 --- a/tests/exceptions.at +++ b/tests/exceptions.at @@ -202,11 +202,17 @@ int exceptions_in_module (void) return 1; } + bool exception_caught = false; try { (*pf) (); } catch (modexc e) { std::cerr << "caught: " << e.what () << '\n'; + exception_caught = true; + } + + if (exception_caught) + { if (lt_dlclose (handle)) { std::cerr << "dlclose failed: " << lt_dlerror () << '\n'; -- 2.47.3