Python 2.7 and greenlets – _PyTrash_thread_deposit_object: Assertion error

Jacek Konieczny jajcus at
Fri Feb 21 14:52:18 CET 2014


I wanted to try out python-gevent. First, I have started with updating
the packages to the newest greenlet and gevent. And there is a problem:
a greenlet test fails with an error:

> PYTHONPATH=build/lib.linux-i686-2.7  python benchmarks/
> python: Objects/object.c:2453: _PyTrash_thread_deposit_object: Assertion `((((((((PyObject*)(op))->ob_type)))->tp_flags & ((1L<<14))) != 0) && ((((PyObject*)(op))->ob_type)->tp_is_gc == ((void *)0) || (((PyObject*)(op))->ob_type)->tp_is_gc(op)))' failed.  Result:Aborted

The test works when I limit the number of greenlets in chain (from the
default 100000) to 33 or less:

> [jajcus at jajo greenlet]$ PYTHONPATH=build/lib.linux-i686-2.7 python benchmarks/ -n 33
> Result: 33
> 0.000419 seconds

According to Google no one else has such a problem.

I have tried different greenlet versions, compiled with different
flags. All greenlet versions > 0.4.0 fail in a similar way.

python-greenlet-0.3.1, when patched as it used to be in our RPM doesn't
fail, but current gevent requires newer greenlet and no one else seems
to use similar patches for newer greenlet versions.

Current python3-greenlet, built from the same source, but for Python3

It seems our python package is broken – maybe some compiler flag is
causing problems, but I have no idea how to further debug this.

Any ideas?


More information about the pld-devel-en mailing list