Segmentation fault in simple gevent queue operations

450 views
Skip to first unread message

Ciprian Dorin Craciun

unread,
Aug 8, 2011, 10:25:00 AM8/8/11
to gev...@googlegroups.com
Hello all!

Eve for a simple operation like:
~~~~
import gevent.queue
q = gevent.queue.Queue ()
q.get (True, 0.1)
~~~~
, I get a segmentation fault.

I have the following packages installed:
* Python 2.7.2 from ArchLinux distribution (2.7.2-2);
* libevent 2.0.12 (2.0.12-1);
* I've installed gevent inside a virtual env with pip, as in:
~~~~
virtualenv --python=`which python2.7` --no-site-packages /tmp/gevent-tests
/tmp/gevent-tests/bin/pip install gevent==0.13.6
# which pulled greenlet-0.3.1
~~~~

Then I test it:
~~~~
/tmp/gevent-tests/bin/python -c
'__import__("gevent.queue").queue.Queue().get(True,0.1)'
# segmentation fault without any other information
~~~~

The non-blocking version works though (or if it doesn't need to block):
~~~~
/tmp/gevent-tests/bin/python -c
'__import__("gevent.queue").queue.Queue().get(False)'
# throws Queue.Empty
~~~~

Any ideea to what is wrong?

Thanks,
Ciprian.

Ralf Schmitt

unread,
Aug 8, 2011, 11:29:41 AM8/8/11
to gev...@googlegroups.com
Ciprian Dorin Craciun <ciprian...@gmail.com> writes:

> Hello all!
>
> Eve for a simple operation like:
> ~~~~
> import gevent.queue
> q = gevent.queue.Queue ()
> q.get (True, 0.1)
> ~~~~
> , I get a segmentation fault.

> Any ideea to what is wrong?

Please try the greenlet version from the bitbucket repository:

https://bitbucket.org/ambroff/greenlet

-----
Cheers,
Ralf

Ciprian Dorin Craciun

unread,
Aug 8, 2011, 11:35:11 AM8/8/11
to gev...@googlegroups.com
So thanks to traviscline and denk on IRC, we've got the following
GDB back-traces:
* http://pastebin.com/raw.php?i=BZptN6h9 -- for my `q.get(True,0.1)` case
* http://pastebin.com/raw.php?i=dTb3qStF -- for greenlet 0.3.1
`setup.py test`

Ciprian.

Ciprian Dorin Craciun

unread,
Aug 8, 2011, 11:49:32 AM8/8/11
to gev...@googlegroups.com


It seems that with greenlet from the above repository (changeset
`4fc947923ee0`) the test works.

Thanks,
Ciprian.

Ciprian Dorin Craciun

unread,
Aug 8, 2011, 12:23:33 PM8/8/11
to gev...@googlegroups.com


I've also added some info about the current problem on the
greenlet bug tracket at the issue, and pointing back to this email
thread:
https://bitbucket.org/ambroff/greenlet/issue/29/segfault-on-fedora-15

Ciprian.

Alexey Borzenkov

unread,
Aug 15, 2011, 6:48:18 PM8/15/11
to gev...@googlegroups.com
On Monday, August 8, 2011 7:29:41 PM UTC+4, Ralf Schmitt wrote:

Please try the greenlet version from the bitbucket repository:

https://bitbucket.org/ambroff/greenlet

Hi,

Unfortunately it has my full-gc support merged, which I later found causes crashes. I was writing about it in one of bug reports, but it looks like my messages were missed (and I've been using my fork without problems for so long that I almost forgot). Right now you are better to either use my fork https://bitbucket.org/snaury/greenlet or wait for Kyle to merge pull request I just created https://bitbucket.org/ambroff/greenlet/pull-request/2/fix-random-crashes

Alexey Borzenkov

unread,
Aug 15, 2011, 7:18:28 PM8/15/11
to gev...@googlegroups.com
Hi,

Can you please see if my fork works? https://bitbucket.org/snaury/greenlet

Thanks,
Alexey.

murchik

unread,
Aug 18, 2011, 9:18:09 AM8/18/11
to gevent: coroutine-based Python network library
I tried it and it totally fixes the thing. Thanks.

Roy Hyunjin Han

unread,
Oct 7, 2011, 4:35:22 PM10/7/11
to gevent: coroutine-based Python network library
On Aug 15, 7:18 pm, Alexey Borzenkov <sna...@gmail.com> wrote:
> Can you please see if my fork works?https://bitbucket.org/snaury/greenlet

Thanks, Alexey. Both your fork and Kyle's development version fixed
the Segmentation Fault error in Fedora 15. I wish Kyle would post the
next version on PyPI at some point.

RHH
Reply all
Reply to author
Forward
0 new messages