From strizhov at netsec.colostate.edu Fri Jan 14 00:09:17 2011 From: strizhov at netsec.colostate.edu (Mikhail Strizhov) Date: Thu, 13 Jan 2011 16:09:17 -0700 Subject: [Expat-discuss] Expat lib and Pthreads Message-ID: <4D2F861D.9010209@netsec.colostate.edu> Greetings list, I have fully working parsing module and I need to use this module with two threads (C pthread library) to parse different xml documents simultaneously. Both threads will launch: XML_Parser parser = XML_ParserCreate(NULL); XML_SetElementHandler(parser, _start_hndl, _end_hndl); XML_SetCharacterDataHandler(parser,_char_hndl ); Will I have inconsistency if both threads will use _start_hndl() and _end_hndl() handler functions? Thanks! -- Sincerely, Mikhail Strizhov Email: strizhov at netsec.colostate.edu From nickmacd at gmail.com Sat Jan 15 17:18:20 2011 From: nickmacd at gmail.com (Nick MacDonald) Date: Sat, 15 Jan 2011 11:18:20 -0500 Subject: [Expat-discuss] Expat lib and Pthreads In-Reply-To: <4D2F861D.9010209@netsec.colostate.edu> References: <4D2F861D.9010209@netsec.colostate.edu> Message-ID: Potentially, yes... depending on how you intend to keep the state of the two threads separate. You may want to learn about the value of User Data, and set your thread state in some data structure, the pointer of which you would pass into eXpat with XML_SetUserData such that it can pass it along to the handler routines and you can use it in the handlers to get access to your thread specific state. XML_SetUserData(XML_Parser p, void *userData) This sets the user data pointer that gets passed to handlers. Good luck with your project... Nick On Thu, Jan 13, 2011 at 6:09 PM, Mikhail Strizhov wrote: > I have fully working parsing module and I need to use this module with two > threads (C pthread library) to parse different xml documents simultaneously. > Both threads will launch: > > XML_Parser parser = XML_ParserCreate(NULL); > XML_SetElementHandler(parser, _start_hndl, _end_hndl); > XML_SetCharacterDataHandler(parser,_char_hndl ); > > Will I have inconsistency if both threads will use _start_hndl() and > _end_hndl() handler functions? From CarstenFuchs at T-Online.de Mon Jan 24 11:34:14 2011 From: CarstenFuchs at T-Online.de (Carsten Fuchs) Date: Mon, 24 Jan 2011 11:34:14 +0100 Subject: [Expat-discuss] Crash in lookup() Message-ID: <4D3D55A6.6080208@T-Online.de> Dear expat list, we're using expat 2.0.1 (with OpenCollada) for loading Collada documents, using Win7 with VC++ 2010. For testing, we also tried the current CVS tarball, with the same results. Unfortunately, when we try to load a simple sample file, we get a segfault in function NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize) The stacktrace without function parameters is at: http://pastebin.com/EN9xkVnr The same stacktrace with function parameters is at: http://pastebin.com/EcXkkXm5 A link to the relevant line of source code is http://trac.cafu.de/browser/cafu/trunk/ExtLibs/expat/lib/xmlparse.c#L5880 where i == 0x38 and table->v[i] == 0xdddddddd (pointer to previously deleted memory). Is this a known bug? What can we do? Any help would much be appreciated! Many thanks and best regards, Carsten -- Cafu - the open-source Game and Graphics Engine for multiplayer, cross-platform, real-time 3D Action Learn more at http://www.cafu.de -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5219 bytes Desc: S/MIME Cryptographic Signature URL: From CarstenFuchs at T-Online.de Mon Jan 24 13:27:40 2011 From: CarstenFuchs at T-Online.de (Carsten Fuchs) Date: Mon, 24 Jan 2011 13:27:40 +0100 Subject: [Expat-discuss] Crash in lookup() In-Reply-To: <4D3D55A6.6080208@T-Online.de> References: <4D3D55A6.6080208@T-Online.de> Message-ID: <4D3D703C.7060609@T-Online.de> Am 2011-01-24 11:34, schrieb Carsten Fuchs: > where i == 0x38 and table->v[i] == 0xdddddddd (pointer to previously deleted memory). Small correction: table->v[i] itself is not 0xdddddddd of course, but the memory it points to is filled by C runtime with 0xdd bytes when it was deleted, and thus table->v[i]->name == 0xdddddddd. Best regards, Carsten -- Cafu - the open-source Game and Graphics Engine for multiplayer, cross-platform, real-time 3D Action Learn more at http://www.cafu.de -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5219 bytes Desc: S/MIME Cryptographic Signature URL: