[xml] segmentation fault



Hi,
I am tracing the cause of a segmentation fault, apparently in the libxml2 module.
My application is purely python and uses the libxml2 library for simple data file look-up.
 
The core file is useless as it just indicates the main module name and a physical memory address that has not meaning to me.
 
The python trace module produces the following:
 
ErrCode.py(43):                 _doc = libxml2.parseFile( self.__dataFile )
ErrCode.py(47):             _ctxt = _doc.xpathNewContext()
ErrCode.py(51):             _xpath = "/ERROR_TABLE/ROW[ code=\"%s\"]/@msg" % code
ErrCode.py(53):             _parms = _ctxt.xpathEval( _xpath )
ErrCode.py(56):             _doc.freeDoc()
 --- modulename: libxml2, funcname: freeDoc
libxml2.py(4079):         libxml2mod.xmlFreeDoc(self._o)
ErrCode.py(57):             _ctxt.xpathFreeContext()
 --- modulename: libxml2, funcname: xpathFreeContext
libxml2.py(6849):         libxml2mod.xmlXPathFreeContext(self._o)

ErrCode.py(64):             for _pm in _parms:
ErrCode.py(65):                 return (code,_pm.content)
 --- modulename: libxml2, funcname: get_content
libxml2.py(267):         return libxml2mod.xmlNodeGetContent(self._o)
Segmentation fault
The purpose of the ErrCode module is to determine if a numberic value (code) exists in the XML described table.
Line 65 returns the first value found. Duplicates are of no concern.
 
Since the symbol _pm is not None, due to the "for _pm...", there must be an issue with the libxml2 object referenced by _pm.
Question: is _pm content valid after the xmlPathFreeContext?.
Ed Oswalt
GE Healthcare
Software Architect
phone: (262) 312-7077
email: Edwin Oswalt med ge com
 


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