[lxml-dev] Unable to solve a crash on Windows with LXML

Stefan Behnel stefan_ml at behnel.de
Fri Feb 6 13:46:31 CET 2009


Robert Liebeskind wrote:
> I have modified my code so that an etree never crosses threads.
> Now the etree is converted to text and then back to an etree in
> the new thread. This has resolved the issue.

That's an extreme measure, but I doubt that it's noticeably slower than
copying the tree. Serialising and parsing is *very* fast in lxml, so this
becomes a safe and simple option.


> Does you know if  lxml 2.2 have the same issue?

There were no changes between 2.1 and 2.2 that could make me expect
anything else. I've resolved a lot of similar issues in the past, so the
conditions under which crashes occur have become more and more obscure. It
would be nice if we could fix this problem for 2.2 final. Could you come
up with a simple setup that mimics what you described as your application
flow? That would allow me to play with it myself.

There's also a set of threading related tests in test_threading.py. IIRC,
we are still missing one that tests a multi-thread XML pipeline as you
use.

Stefan



More information about the lxml-dev mailing list