]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
[cygwin] Fix segfault in C++ exception handling test
authorCharles Wilson <libtool@cwilson.fastmail.fm>
Sat, 19 Jun 2010 20:29:45 +0000 (16:29 -0400)
committerCharles Wilson <libtool@cwilson.fastmail.fm>
Sat, 19 Jun 2010 21:46:56 +0000 (17:46 -0400)
* 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 <libtool@cwilson.fastmail.fm>
ChangeLog
tests/exceptions.at

index ae3790698c4f2b642947517c5fd8fca452891e88..17a140675f0ef5a2268922fbc8c2997eb5f42d5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-19  Charles Wilson  <libtool@cwilson.fastmail.fm>
+
+       [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  <Ralf.Wildenhues@gmx.de>
 
        Fix srcdir computation for manual runs of old tests.
index 293723c77cf11a0534e7289bec9668c70ee0a24c..23442a356f1a67d13e505ef786197f8cf0d7aaf0 100644 (file)
@@ -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';