[lxml-dev] lxml 2.1.4/2.2beta1 Solaris 9 segv in test-suite

Hi, I just compiled lxml-2.1.4 (and lxml-2.2beta) with gcc 4.2.4 against - libxml2-2.7.2 - libxslt-1.1.24 Unfortunately the test "test_schematron_invalid_schema_empty" causes a segmentation violation with Python 2.5 and Python 2.6; Please find a gdb backtrace for Python 2.6 and lxml-2.1.4 (and lxml-2.2beta) attached. Regards, Volker Paulsen -- OrbiTeam Software GmbH & Co. KG http://www.orbiteam.de/ () Ascii Ribbon Campaign /\ Support plain text e-mail

Hi, thanks for the report. Volker Paulsen wrote:
I don't think I've seen this before, might be specific to Solaris. From the stack trace, it's not sure that the problem is in lxml, as the error is handled purely inside libxml2 up to that point. I'd say you're safe if you don't use schematron (which most people won't run into anyway). Could you try to reproduce this with 'xmllint' (comes with libxml2) and the empty schema given by the test case? <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> That would allow us to see if it's a problem with libxml2. Thanks, Stefan

Hi Stefan, On Tue, Dec 23, 2008 at 07:38:52AM +0100, Stefan Behnel wrote:
Actually I am not an XML-Crack... $ cat schematron.dsdl <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> $ /usr/local/bin/xmllint --version /usr/local/bin/xmllint: using libxml version 20702 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib $ /usr/local/bin/xmllint schematron.dsdl <?xml version="1.0"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"/> $ /usr/local/bin/xmllint --valid schematron.dsdl schematron.dsdl:1: validity error : Validation failed: no DTD found ! <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> ^ <?xml version="1.0"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"/> Is this helpful? Regards, Volker Paulsen -- OrbiTeam Software GmbH & Co. KG http://www.orbiteam.de/ () Ascii Ribbon Campaign /\ Support plain text e-mail

Hi, On Tue, Jan 06, 2009 at 11:14:57AM +0100, Stefan Behnel wrote:
There we are: $ /usr/local/bin/xmllint --schematron schematron.dsdl schematron.dsdl schematron.dsdl:1: element schema: Schemas parser error : The schematron document 'schematron.dsdl' has no pattern Schematron schema schematron.dsdl failed to compile <?xml version="1.0"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"/> Regards, Volker Paulsen -- OrbiTeam Software GmbH & Co. KG http://www.orbiteam.de/ () Ascii Ribbon Campaign /\ Support plain text e-mail

Hi, I just noticed this thread:
Unfortunately the test "test_schematron_invalid_schema_empty" causes a segmentation violation with Python 2.5 and Python 2.6;
I've also run into this in Solaris 8 some time ago but never got round to really look into it (we don't use schematron at the moment). Here's what I found out then: " 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. " You can also find this here: http://thread.gmane.org/gmane.comp.python.lxml.devel/3073 I also noticed that xmllint does not suffer from this problem: " What I can see, though, is that using the same schematron schema with xmllint does not crash: 0 $ cat invalid_empty.xst <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> 0 $ python2.4 -i -c 'from lxml import etree; print etree.LIBXML_VERSION; schema = etree.Schematron(etree.parse("invalid_empty.xst"))' (2, 6, 30) Segmentation Fault (core dumped) whereas $ /apps/pydev/bin/xmllint --schematron invalid_empty.xst foo.xml --version /apps/pydev/bin/xmllint: using libxml version 20630 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib invalid_empty.xst:1: element schema: Schemas parser error : The schematron document 'invalid_empty.xst' has no pattern Schematron schema invalid_empty.xst failed to compile <?xml version="1.0"?> <root/> " (archived: http://article.gmane.org/gmane.comp.python.lxml.devel/3011) I've been using older libxml2/libxslt versions then, obviously, but the failure does appears to be the same. Happy new year everyone, Holger -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Hi, thanks for the report. Volker Paulsen wrote:
I don't think I've seen this before, might be specific to Solaris. From the stack trace, it's not sure that the problem is in lxml, as the error is handled purely inside libxml2 up to that point. I'd say you're safe if you don't use schematron (which most people won't run into anyway). Could you try to reproduce this with 'xmllint' (comes with libxml2) and the empty schema given by the test case? <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> That would allow us to see if it's a problem with libxml2. Thanks, Stefan

Hi Stefan, On Tue, Dec 23, 2008 at 07:38:52AM +0100, Stefan Behnel wrote:
Actually I am not an XML-Crack... $ cat schematron.dsdl <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> $ /usr/local/bin/xmllint --version /usr/local/bin/xmllint: using libxml version 20702 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib $ /usr/local/bin/xmllint schematron.dsdl <?xml version="1.0"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"/> $ /usr/local/bin/xmllint --valid schematron.dsdl schematron.dsdl:1: validity error : Validation failed: no DTD found ! <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> ^ <?xml version="1.0"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"/> Is this helpful? Regards, Volker Paulsen -- OrbiTeam Software GmbH & Co. KG http://www.orbiteam.de/ () Ascii Ribbon Campaign /\ Support plain text e-mail

Hi, On Tue, Jan 06, 2009 at 11:14:57AM +0100, Stefan Behnel wrote:
There we are: $ /usr/local/bin/xmllint --schematron schematron.dsdl schematron.dsdl schematron.dsdl:1: element schema: Schemas parser error : The schematron document 'schematron.dsdl' has no pattern Schematron schema schematron.dsdl failed to compile <?xml version="1.0"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron"/> Regards, Volker Paulsen -- OrbiTeam Software GmbH & Co. KG http://www.orbiteam.de/ () Ascii Ribbon Campaign /\ Support plain text e-mail

Hi, I just noticed this thread:
Unfortunately the test "test_schematron_invalid_schema_empty" causes a segmentation violation with Python 2.5 and Python 2.6;
I've also run into this in Solaris 8 some time ago but never got round to really look into it (we don't use schematron at the moment). Here's what I found out then: " 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. " You can also find this here: http://thread.gmane.org/gmane.comp.python.lxml.devel/3073 I also noticed that xmllint does not suffer from this problem: " What I can see, though, is that using the same schematron schema with xmllint does not crash: 0 $ cat invalid_empty.xst <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> 0 $ python2.4 -i -c 'from lxml import etree; print etree.LIBXML_VERSION; schema = etree.Schematron(etree.parse("invalid_empty.xst"))' (2, 6, 30) Segmentation Fault (core dumped) whereas $ /apps/pydev/bin/xmllint --schematron invalid_empty.xst foo.xml --version /apps/pydev/bin/xmllint: using libxml version 20630 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib invalid_empty.xst:1: element schema: Schemas parser error : The schematron document 'invalid_empty.xst' has no pattern Schematron schema invalid_empty.xst failed to compile <?xml version="1.0"?> <root/> " (archived: http://article.gmane.org/gmane.comp.python.lxml.devel/3011) I've been using older libxml2/libxslt versions then, obviously, but the failure does appears to be the same. Happy new year everyone, Holger -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
participants (3)
-
jholg@gmx.de
-
Stefan Behnel
-
Volker Paulsen