[lxml-dev] empty schematron test segfault, revisited

jholg at gmx.de jholg at gmx.de
Mon Oct 22 15:38:30 CEST 2007


Hi,

I'm taking another look at the seqfaults I see with schematron support, and:

0 lb54320 at adevp02 .../XML $ PYTHONPATH=/data/pydev/hjoukl/LXML/lxml/build/lib.solaris-2.8-sun4u-2.4 python2.4 -c "from lxml import etree; tree=etree.parse('invalid_empty.xst'); schema = etree.Schematron(etree=tree)"
Segmentation Fault (core dumped)
139 lb54320 at adevp02 .../XML $ PYTHONPATH=/data/pydev/hjoukl/LXML/lxml/build/lib.solaris-2.8-sun4u-2.4 python2.4 -c "from lxml import etree; schema = etree.Schematron(file='invalid_empty.xst')"
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "schematron.pxi", line 111, in lxml.etree.Schematron.__init__
lxml.etree.SchematronParseError: Document is not a valid Schematron schema
1 lb54320 at adevp02 .../XML $

When handing in a pre-parsed tree I run into the segfault, whereas I get a correct error message when leaving file parsing to xmlSchematronParse().

As different parser context factories (xmlSchematronNewDocParserCtxt / xmlSchematronNewParserCtxt ) get used for the 2 entry points, I suspect that s.th. in libxml2 is buggy here, i.e. that xmlSchematronNewDocParserCtxt forgets to initialize something crucial that is then erroneously accessed in the error reporting.

Holger




-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser


More information about the lxml-dev mailing list