Re: [xml] Strange segmentation fault on Win32 with htmlCreatePushParserCtxt



Hi Igor,

Ho Matthew,

I'll try and get you some example code tomorrow :-)

Good :-)

I haven't had a chance to really dig through the code (deadlines,
deadlines)
but I think the problem is due to us loading our DLL with LoadLibrary.


What? LoadLibrary? Well then... hello Dr. Watson, how are you today? :-)

The compiler-supported incarnation of TLS does not initialise local storage
for threads which existed before the library was loaded. If one of these
threads tries to access its nonexistent TLS, then you'll have Dr. Watson
examining the scene.

This can be solved by not using the declspec and using the TLS API instead.

which apparently is a bad thing to do with TLS. Would it be possible
to move the flag and state pointer into thread data and remove the
use of the Microsoft declspec?

I have no problems with removing that MSC-specific bit. The TLS API code
which would then take over is allready there.

Perhaps change the section of code which references the variables into
a critical section (or mutexed)?  Since it seems that it is only be the
GlobalStatePtr and it's initialization flag which gets lost. I assume that
this is "global" global :-)

No, that's not the problem, see above.

Ciao
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]