[pypy-dev] [cpyext] crash in PyThreadState_GetDict()

Stefan Behnel stefan_ml at behnel.de
Mon Jun 18 19:04:48 CEST 2012


Amaury Forgeot d'Arc, 18.06.2012 16:51:
> 2012/6/18 Stefan Behnel
>> Amaury Forgeot d'Arc, 18.06.2012 16:02:
>>> 2012/6/18 Stefan Behnel
>>>> I'm getting reproducible segfaults in the PyThreadState_GetDict()
>>>> function with lxml.
>>>
>>> Is it similar to https://bugs.pypy.org/issue1175 ?
>>> "PyThread_{get, set, delete}_key_value should work without the GIL held"
>>
>> No. As I said, it has already acquired the GIL when it calls that function.
> 
> OK, the answer is quite simple:
> PyGILState_Ensure() is not really implemented and just returns zero.

Ah, hmmm. That's annoying. Threading is quite crucial for many use cases of
lxml. Is there a chance that this will become available soonish, or should
I just compile out threading support when building in PyPy? The code for
that is there anyway (although I haven't tried it in years...).

Maybe PyPy should undefine the WITH_THREAD macro if it doesn't support
threading in C extensions anyway?

Stefan



More information about the pypy-dev mailing list