On Fri, 2008-08-08 at 08:25 +0200, Stefan Behnel wrote:
Hi,
John Krukoff wrote:
On Fri, 2008-08-01 at 08:47 +0200, Stefan Behnel wrote:
Hi,
John Krukoff wrote:
Okay, can only get it to crash when first signing a document using libxmlsec, so I suppose I'll simply assume that the two libraries use the error log in incompatible ways. could you check if this patch makes it work better for you? It basically restricts XSLT error logging to the lifetime of an XSL transformation.
Stefan
I still need to compile lxml with -ggdb, where do I stick that in the setup.py/makefile?
Pass the "CFLAGS" env variable when calling setup.py, as in
CFLAGS="-O -ggdb" make clean inplace
still crashed with the patch for me:
Core was generated by `/usr/bin/python -tt ./Adapter.py'. Program terminated with signal 11, Segmentation fault. #0 0xb774b740 in __pyx_f_4lxml_5etree__forwardError ()
from /usr/lib/python2.5/site-packages/lxml-2.1.1-py2.5-linux-i686.egg/lxml/etree.so (gdb) bt #0 0xb774b740 in __pyx_f_4lxml_5etree__forwardError ()
from /usr/lib/python2.5/site-packages/lxml-2.1.1-py2.5-linux-i686.egg/lxml/etree.so #1 0xb774bb12 in __pyx_f_4lxml_5etree__receiveXSLTError ()
from /usr/lib/python2.5/site-packages/lxml-2.1.1-py2.5-linux-i686.egg/lxml/etree.so #2 0xb76baef9 in xsltPrintErrorContext () from /usr/lib/libxslt.so.1 #3 0xb76bb091 in xsltTransformError () from /usr/lib/libxslt.so.1 #4 0xb76dd434 in xsltValueOf () from /usr/lib/libxslt.so.1 #5 0xb76da5ba in ?? () from /usr/lib/libxslt.so.1 #6 0x0878e718 in ?? () #7 0x08432c60 in ?? () #8 0x0878ec78 in ?? () #9 0x0878f6f8 in ?? () #10 0x00000000 in ?? ()
Fortunately, I've been able to simplify my crash conditions somewhat, so the valgrind log is significantly shorter.
You can generally strip the "... within /lib/ld-2.6..." entries from it.
Looks like I'll need to find some time to work on that test case after all.
Please do, and also re-run your valgrind test with -ggdb. There seem to be some interesting problems in there (the "moveNodeToDocument()" sections), even if only crashes later. Seeing the line numbers here would really be helpful.
Stefan
Okay, I can get a segfault with this minimal test case, where variable.xslt is the previously sent XSLT sheet which references an undefined parameter in an xpath expression: Python 2.5.2 (r252:60911, Jul 31 2008, 15:38:58) [GCC 4.1.2 (Gentoo 4.1.2 p1.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
from lxml import etree import xmlsig etree.XSLT( etree.parse( 'variable.xslt' ) )( etree.XML( '<a/>' ) ) xmlXPathCompiledEval: evaluation failed Segmentation fault
However, changing the import order causes the crash to go away, I assume due to order of initialization in the logging code: ~/Projects/Gizmo/www/Samples 17$ python Python 2.5.2 (r252:60911, Jul 31 2008, 15:38:58) [GCC 4.1.2 (Gentoo 4.1.2 p1.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import xmlsig from lxml import etree etree.XSLT( etree.parse( 'variable.xslt' ) )( etree.XML( '<a/>' ) ) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "xslt.pxi", line 529, in lxml.etree.XSLT.__call__ (src/lxml/lxml.etree.c:91033) lxml.etree.XSLTApplyError: XPath evaluation returned no result.
Here is the backtrace from the crash with debugging info:
Core was generated by `python'.
Program terminated with signal 11, Segmentation fault.
#0 0xb78ce53b in __pyx_f_4lxml_5etree__forwardError
(__pyx_v_c_log_handler=<value optimized out>, __pyx_v_error=0xbfba01c8)
at src/lxml/lxml.etree.c:40855
40855 ((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog
*)__pyx_v_log_handler->__pyx_vtab)->_receive(__pyx_v_log_handler,
__pyx_v_error);
(gdb) bt
#0 0xb78ce53b in __pyx_f_4lxml_5etree__forwardError
(__pyx_v_c_log_handler=<value optimized out>, __pyx_v_error=0xbfba01c8)
at src/lxml/lxml.etree.c:40855
#1 0xb78ce79c in __pyx_f_4lxml_5etree__receiveXSLTError
(__pyx_v_c_log_handler=0xb75fcf04,
__pyx_v_msg=0xb7880450 "%s: file %s line %d element %s\n") at
src/lxml/lxml.etree.c:41371
#2 0xb7859ef9 in xsltPrintErrorContext () from /usr/lib/libxslt.so.1
#3 0xb785a091 in xsltTransformError () from /usr/lib/libxslt.so.1
#4 0xb787c434 in xsltValueOf () from /usr/lib/libxslt.so.1
#5 0xb78795ba in ?? () from /usr/lib/libxslt.so.1
#6 0x0812bdb8 in ?? ()
#7 0x08127100 in ?? ()
#8 0x08124b60 in ?? ()
#9 0x08108eb0 in ?? ()
#10 0x00000000 in ?? ()
Attached is the valgrind log from the crash. Hope this helps. All of
these are with the XSLT error logging patch you sent along previously.
--
John Krukoff