Re: Statically initialising pthread attributes in dynamic dlls.

2010-02-24 Thread Andrew West
On 24/02/2010 05:26, Dave Korn wrote: Yeh, that works nicely. Here's what I tested, along with a couple of extra test cases I used to check whether exception handling was still working before and after the dlopen call. With the current state of HEAD, the first one works (by which I mean "pri

Re: Statically initialising pthread attributes in dynamic dlls.

2010-02-23 Thread Andrew West
On 23/02/2010 10:00, Andrew West wrote: With the code I'm testing against, the exception handler isn't called in the library and it bombs out there. :( The dll initialisation stuff calls '_cygtls::init_exception_handler' but it doesn't insert it because it finds

Statically initialising pthread attributes in dynamic dlls.

2010-02-22 Thread Andrew West
Trying to initialise a pthread attribute in a static variable seems to cause a segfault. I've attach a simple test case compiled using; g++ -g mutex.cpp -o mutex.dll -lpthread g++ -g test.cpp -o test.exe -ldl I've cropped the code down to the essential bits, so no error reporting if it can't f

Re: AW: [bulk] - Re: One Problem solved other found -> dlclose not calling destructors

2010-02-05 Thread Andrew West
On 05/02/2010 08:27, DEWI - N. Zacharias wrote: Second I know it is hard to fix things if the reports are unspecific. But I'm really not able to give more precise reports. Corinna send different dlls which I testedaccording to her advice and give feedback. I suggest

Re: dlclose not calling destructors of static variables.

2010-02-02 Thread Andrew West
On 02/02/2010 15:16, Christopher Faylor wrote: On Tue, Feb 02, 2010 at 09:36:54AM +, Andrew West wrote: O.k. I've changed remove_dll_atexit to; remove_dll_atexit (const dll *d) { unsigned char *dll_beg = (unsigned char *) d->handle + 0x1000; unsigned char

Re: dlclose not calling destructors of static variables.

2010-02-02 Thread Andrew West
On 01/02/2010 21:24, Dave Korn wrote: On 01/02/2010 20:45, Andrew wrote: I'm not looking to submit a patch to fix this, I'll leave that up to the professionals who have a better idea about the whole picture. It's just I've hit a brick wall with my code with this bug so I'm looking for some

Re: dlclose not calling destructors of static variables.

2010-02-02 Thread Andrew West
On 01/02/2010 22:44, Dave Korn wrote: On 01/02/2010 17:35, Andrew West wrote: But the atexit function is registered at 0x706c10f0. Changing AllocationBase to BaseAddress worked for my test case out of pure luck, with my larger libraries it still failed. I've managed to con

Re: dlclose not calling destructors of static variables.

2010-02-01 Thread Andrew West
On 01/02/2010 16:26, Christopher Faylor wrote: Could you clarify? Are you saying that your test case still failed? With the change you provided my test still failed, but changing m.AllocationBase to m.BaseAddress it worked. Unfortunately it only worked for that test cash, on trying it wit

Re: dlclose not calling destructors of static variables.

2010-02-01 Thread Andrew West
On 29/01/2010 18:45, Christopher Faylor wrote: On Fri, Jan 29, 2010 at 02:30:48PM +, Andrew West wrote: On 29/01/2010 13:08, Dave Korn wrote: On 28/01/2010 11:21, Andrew West wrote: I seem to be having a problem with dlclose not calling the destructors of statically

Re: dlclose not calling destructors of static variables.

2010-01-29 Thread Andrew West
On 29/01/10 18:45, Christopher Faylor wrote: On Fri, Jan 29, 2010 at 02:30:48PM +, Andrew West wrote: On 29/01/2010 13:08, Dave Korn wrote: On 28/01/2010 11:21, Andrew West wrote: I seem to be having a problem with dlclose not calling the destructors of statically

Re: dlclose not calling destructors of static variables.

2010-01-29 Thread Andrew West
On 29/01/2010 15:23, Dave Korn wrote: On 29/01/2010 14:30, Andrew West wrote: Which brings me on to the bigger problem, the static variables are registered with atexit rather than with __cxa_atexit which seems to be a violation of the C++ standard (1). That's not the C++ sta

Re: dlclose not calling destructors of static variables.

2010-01-29 Thread Andrew West
On 29/01/2010 13:08, Dave Korn wrote: On 28/01/2010 11:21, Andrew West wrote: I seem to be having a problem with dlclose not calling the destructors of statically declared variables. I've attached a simple test case which I compile as follows; Thanks for the report and th

dlclose not calling destructors of static variables.

2010-01-28 Thread Andrew West
I seem to be having a problem with dlclose not calling the destructors of statically declared variables. I've attached a simple test case which I compile as follows; testlib.cpp g++ -g -shared testlib.cpp -o testlib testrunner.cpp g++ -g testrunner.cpp -o testrunner -ldl When running testrunn