[lxml-dev] Proxy AssertionError in threaded tree traversal
Holger Joukl
Holger.Joukl at LBBW.de
Mon Feb 12 09:44:59 CET 2007
Hi,
Stefan Behnel <stefan_ml at behnel.de> schrieb am 10.02.2007 22:14:32:
> Stefan Behnel wrote:
> > What you observe is definitely a threading issue. The code in
> _elementFactory
> > (etree.pyx) suggests that different threads are concurrently
> creating proxies
> > for the same node.
>
> Rethinking this, I'm now wondering how this should be possible. The
function
> uses Python code, so we are always sure it is protected by the GIL when
it is
> called (otherwise we'd get a Python crash), so there /is/ no concurrency
here.
Is the compiled-to-C _registerProxy function an atomic operation regarding
GIL-
locking? Because inside it uses Python-API calls itself, wouldn't that mean
there
can be a thread change when in the function?
> Could you try to come up with a (preferably short) list of things that
your
> threads are doing concurrently? Knowing which parts of the API are used
should
> make it easier to see where the problem might arise.
I'm currently failing to put together some sort of minimal example but I've
just seen the AssertionError in code where I actually _do_ deepcopy the
element
before the worker thread does anything on it.
We are currently trying to track down severe segfault/bus error problems
and
right now I'm still unsure which of the components is responsible for them.
But I'm beginning to think that the AssertionError is merely another
symptom
of this, meaning that c_node._private has been corrupted by the villain,
whoever it is.
I'm now trying to strip down my test programs and will probably try to
recompile with
different libxml2/libxslt versions.
Holger
Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene
Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde,
verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail
sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht
gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht
garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte
den Inhalt der E-Mail als Hardcopy an.
The contents of this e-mail are confidential. If you are not the named
addressee or if this transmission has been addressed to you in error,
please notify the sender immediately and then delete this e-mail. Any
unauthorized copying and transmission is forbidden. E-Mail transmission
cannot be guaranteed to be secure. If verification is required, please
request a hard copy version.
Landesbank Baden-Württemberg
Anstalt des öffentlichen Rechts
Hauptsitze: Stuttgart, Karlsruhe, Mannheim
More information about the lxml-dev
mailing list