[lxml-dev] Segfault on XSLT/XPath undefined variable error.
Stefan Behnel
stefan_ml at behnel.de
Wed Jul 30 07:52:25 CEST 2008
Hi,
thanks for the report.
John Krukoff wrote:
> So, I've got a tricky to repeat segfault that occurs on an edge case,
> and I'm wondering if it's even an lxml bug, or a libxslt bug?
>
> What appears to be happening, is that if I run this stylesheet which has
> an undefined variable reference in an xpath expression, sometimes I can
> get a segfault.
>From the scenario and the little information your stack trace provides, an
educated guess is that this happens in the error logger when libxslt tells
lxml.etree about a problem it has found (likely the unknown variable, but
there are usually more errors reported). The requirement to run other
operations before this problem occurs might indicate a problem when the error
log is being rotated when it fills up, or something like that.
I'm not aware of any such problem, though, and your lib versions are pretty
recent.
> A coworker noticed this
> problem, his symptoms were different, instead of segfaulting, the XSLT
> parser would unexpectedly exit (with no exception!) at the point where
> the invalid xpath was run, returning whatever result document had been
> generated up to that point.
He/she is likely using an older lxml version. The XSLT error reporting in this
case was fixed in 2.0.5.
> I'll run it through valgrind tomorrow when I have more time, and see if
> that provides anything interesting.
Please do, but use a debug build of a source release (without having Cython
installed!), so that I can look up the line numbers.
Stefan
More information about the lxml-dev
mailing list