[lxml-dev] Test failures on Windows
Stefan Behnel
behnel_ml at gkec.informatik.tu-darmstadt.de
Sat Oct 28 16:12:30 CEST 2006
Hi,
Sidnei da Silva wrote:
> On Sat, Oct 28, 2006 at 03:43:05PM +0200, Stefan Behnel wrote:
> | It is pretty expensive to allocate. There are some hash-table allocations
> | involved that are rather costly (that's why there is a function for resetting
> | the context). In lxml, we try to reuse context objects wherever possible.
>
> One last question, do you have a small test that can reproduce the
> segfault or is it just random? I would like to spend some time
> tracking that one down.
No need to do that. It's in line 12837 in file parser.c. Apparently, the
assumption that ctxt->spaceTab has always been initialised when calling
xmlCtxtReset() is wrong. Here's my bug report:
http://bugzilla.gnome.org/show_bug.cgi?id=366161
My current work around is to do the NULL check myself and to initialise it the
way libxml2 normally does before calling the reset. That's what's I'd normally
expect libxml2 to do...
BTW, I don't know in which cases this field remains uninitialised, so if you
want to add some more infos to the bug report, feel free to investigate. I
only know that it definitely happens in the case where we call
xmlCtxtReadFile(). It is possible that this requires previous runs of the
parser, maybe even a failed run preceding the crash, can't tell...
Stefan
More information about the lxml-dev
mailing list