[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] [cygwin] Fix segfault in C++ exception handling test
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH] [cygwin] Fix segfault in C++ exception handling test |
Date: |
Sun, 20 Jun 2010 19:14:27 +0200 |
User-agent: |
Mutt/1.5.20 (2010-04-22) |
* Charles Wilson wrote on Sat, Jun 19, 2010 at 10:29:45PM CEST:
> * 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.
Yep. Fixes the failure on HP-UX/ia64 and some other systems well.
I'm adding a comment to the code, as below, because I find the issue
nonobvious, and this code in particular should serve as example code.
Thanks,
Ralf
Add comment for exception handling module unloading issue.
* tests/exceptions.at (C++ exception handling): Add comment
for last patch.
diff --git a/tests/exceptions.at b/tests/exceptions.at
index 23442a3..aaebd0f 100644
--- a/tests/exceptions.at
+++ b/tests/exceptions.at
@@ -211,6 +211,7 @@ int exceptions_in_module (void)
exception_caught = true;
}
+ /* Only close the module after all of its objects have gone out of scope. */
if (exception_caught)
{
if (lt_dlclose (handle))