[xml] Problem with pthread on Solaris 2.6



Hello,

I am having a problem on Solaris 2.6 with pthread.  The process that I am running is not a threaded process 
but Solaris is treating it like a threaded process.  I do not want this because it creates a bunch of useless 
threads and it is causing problems with some tools we use.  I think I read somewhere that on Solaris 2.6 if 
you link in "-lthread" or "-lpthread" your task is considered multithreaded.   So I compiled my executable 
without "-lpthread" and it linked fine.  But when I attempt to run the executable it core dumps when I read 
in a file.  Keep in mind it runs fine when I link in pthread.  From the debug info I provided below you can 
see that for the case where I link in pthread the hdlr variable passed into xmlSAXVersion() seems to be set 
correctly.  But for the case where I am getting the core dump this variabe does not seem to be set to valid 
values.  

Has anyone ever seen this before? I have tried configuring the XML library with "--without-threads" but that 
did not work. I am using libxml2-2.6.5.  Any help would be appreciated.


Thanks,
Will



<< GOOD CASE:  linked with "-lpthread" >>

   xmlReadFile(filename = 0x16c528 "<path removed>/.samt_config.xml", encoding = (nil), options = 96)
   xmlCreateURLParserCtxt(filename = 0x16c528 "<path removed>/.samt_config.xml", options = 96)
   xmlNewParserCtxt()
   xmlInitParserCtxt(ctxt = 0x199878)
   xmlDefaultSAXHandlerInit()
  xmlSAXVersion(hdlr = 0x1939b4, version = 1)

<<xmlSAXVersion hdlr:  pthread linked in>>:
*hdlr = {
   internalSubset        = 0x1426a8 = &xmlSAX2InternalSubset(void *ctx, const xmlChar *name, const xmlChar
 *ExternalID, const xmlChar *SystemID) 
   isStandalone          = 0x142560 = &xmlSAX2IsStandalone(void *ctx) 
   hasInternalSubset     = 0x1425c8 = &xmlSAX2HasInternalSubset(void *ctx) 
   hasExternalSubset     = 0x142638 = &xmlSAX2HasExternalSubset(void *ctx) 
   resolveEntity         = 0x142d58 = &xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar
 *systemId) 
   getEntity             = 0x142e80 = &xmlSAX2GetEntity(void *ctx, const xmlChar *name) 
   entityDecl            = 0x143370 = &xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, const 
xmlChar
 *publicId, const xmlChar *systemId, xmlChar *content) 
   notationDecl          = 0x143dd8 = &xmlSAX2NotationDecl(void *ctx, const xmlChar *name, const xmlChar 
*publicId,
 const xmlChar *systemId) 
   attributeDecl         = 0x1437e0 = &xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar 
*fullname,
 int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) 
   elementDecl           = 0x143b68 = &xmlSAX2ElementDecl(void *ctx, const xmlChar *name, int type,
 xmlElementContentPtr content) 
   unparsedEntityDecl    = 0x144110 = &xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, const xmlChar
 *publicId, const xmlChar *systemId, const xmlChar *notationName) 
   setDocumentLocator    = 0x144580 = &xmlSAX2SetDocumentLocator(void *ctx, xmlSAXLocatorPtr loc) 
   startDocument         = 0x1445b0 = &xmlSAX2StartDocument(void *ctx) 
   endDocument           = 0x1449c8 = &xmlSAX2EndDocument(void *ctx) 
   startElement          = 0x146c98 = &xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const unsigned 
char
 **atts) 
   endElement            = 0x147880 = &xmlSAX2EndElement(void *ctx, const xmlChar *name) 
   reference             = 0x1499c8 = &xmlSAX2Reference(void *ctx, const xmlChar *name) 
   characters            = 0x149a90 = &xmlSAX2Characters(void *ctx, const xmlChar *ch, int len) 
   ignorableWhitespace   = 0x149a90 = &xmlSAX2Characters(void *ctx, const xmlChar *ch, int len) 
   processingInstruction = 0x14a108 = &xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target, const 
xmlChar
 *data) 
   comment               = 0x14a2e0 = &xmlSAX2Comment(void *ctx, const xmlChar *value) 
   warning               = 0x157da8 = &xmlParserWarning() 
   error                 = 0x157a38 = &xmlParserError() 
   fatalError            = 0x157a38 = &xmlParserError() 
   getParameterEntity    = 0x1432f8 = &xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name) 
   cdataBlock            = 0x14a4a8 = &xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len) 
   externalSubset        = 0x1427e0 = &xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, const xmlChar
 *ExternalID, const xmlChar *SystemID) 
   initialized           = 0 
   _private              = 0x142418 
   startElementNs        = 0x142458 = &xmlSAX2GetSystemId(void *ctx) 
   endElementNs          = 0x1424b0 = &xmlSAX2GetLineNumber(void *ctx) 
   serror                = 0x142508 = &xmlSAX2GetColumnNumber(void *ctx)
}



<< CORE DUMP CASE:  linked without "-lpthread" >>

   xmlReadFile(filename = 0x16c4e0 "<path removed>/.samt_config.xml", encoding = (nil), options = 96)
   xmlCreateURLParserCtxt(filename = 0x16c4e0 "<path removed>/.samt_config.xml", options = 96)
   xmlNewParserCtxt()
   xmlInitParserCtxt(ctxt = 0x1989e0)
   xmlDefaultSAXHandlerInit()
  xmlSAXVersion(hdlr = 0xef640014, version = 1)

<<SAXVersion hdlr:  NO pthread linked in>>:
*`test_program.exe`SAX2.c`xmlSAXVersion`hdlr = {
   internalSubset        = 0x1 
   isStandalone          = 0x74 
   hasInternalSubset     = 0x34 
   hasExternalSubset     = 0x4020 
   resolveEntity         = 0x300 
   getEntity             = 0x340020 
   entityDecl            = 0x20028 
   notationDecl          = 0xd000c = &htmlSetMetaEncoding() 
   attributeDecl         = 0x1 
   elementDecl           = (nil) 
   unparsedEntityDecl    = (nil) 
   setDocumentLocator    = (nil) 
   startDocument         = 0x3560 
   endDocument           = 0x3560 
   startElement          = 0x5 
   endElement            = 0x4 
   reference             = 0x2 
   characters            = 0x74 
   ignorableWhitespace   = 0x74 
   processingInstruction = (nil) 
   comment               = 0x48 
   warning               = (nil) 
   error                 = 0x7 
   fatalError            = (nil) 
   getParameterEntity    = 0xe 
   cdataBlock            = 0xc6 
   externalSubset        = 0x6ffffffc 
   initialized           = 1192U 
   _private              = 0x6ffffffd 
   startElementNs        = 0x2 
   endElementNs          = 0x4 
   serror                = 0xbc
}






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