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



Ok,

I've narrowed it down to the use of __declspec(thread) in the declaration
of the two variables tlstate and tlstate_inited.

If I remove the declspec everything seems to work fine. My question now
is, what is the reason for using TLS?


Matthew Love
Software Engineer

NETWORK HARMONi, Inc.
matthew networkharmoni com
Ph +61 8 92133412

----- Original Message -----
From: "Matthew Love" <matthew networkharmoni com au>
To: "Matthew Love" <matthew networkharmoni com au>; <xml gnome org>
Sent: Wednesday, October 30, 2002 12:37 PM
Subject: Re: [xml] Strange segmentation fault on Win32 with
htmlCreatePushParserCtxt


It seems that the issue is due to threads. As soon as I start using more
than
one thread in my application, I'm get this null ptr dereference. Has
anyone
else found any problems with using libxml2 under win32 with threads?

whenever I call htmlCreatePushParserCtxt later on. The stack trace of
the problem is as follows

xmlGetGlobalState + 15 bytes <--------- NULL pointer dereference.
__xmlDefaultBufferSize + 24 bytes
xmlBufferCreate + 66 bytes
xmlAllocParserInputBuffer + 72 bytes
htmlCreatePushParserCtxt + 22 bytes

If I remove the call to xmlInitParser, every thing is ok. I'm not sure
if
this
is user error, library configuration (I'vI enabled threads when building
libxml)
or an actual bug. (I'm thinking user error at the moment).






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