[pypy-dev] Dead loop occurs when using python-daemon and multiprocessing together in PyPy 4.0.1

hubo hubo at jiedaibao.com
Wed Dec 23 05:03:25 EST 2015


Hello devs,

A (possible) dead loop is found when I use python-daemon and multiprocessing together in PyPy 4.0.1, which does not appear in Python(2.6 or 2.7). Also it does not appear in earlier PyPy versions (2.0.2)

Reproduce:

First install python-daemon:
pypy_pip install python-daemon

Use the following test script (also available in attachment):

#!/usr/bin/pypy
import daemon
import multiprocessing
def test():
    q = multiprocessing.Queue(64)
if __name__ == '__main__':
    with daemon.DaemonContext():
        test()

When executing the script with pypy:
pypy test.py

The background service does not exit, and is consuming 100% CPU:
ps aux | grep pypy
root      7769 99.1  0.5 235332 46812 ?        R    17:52   2:09 pypy test.py
root      7775  0.0  0.0 103252   804 pts/1    S+   17:54   0:00 grep pypy




Executing the script with python:
python2.7 test.py
And the background service normally exits.

Environment:
I'm using CentOS 6.5, with portable PyPy distribution for linux (https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-4.0.1-linux_x86_64-portable.tar.bz2)
I run the script on system built-in python (python 2.6.6), a compiled CPython (2.7.11), and pypy from epel-release(pypy 2.0.2, python 2.7.2), and the problem does not appear. Though the compiled CPython is 2.7.11 and PyPy 4.0.4 is python 2.7.10, I think that does not matter much.

Please contact if you have any questions or ideas.


2015-12-23


hubo 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20151223/570e8677/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Clip(12-23-17-55-26).png
Type: image/png
Size: 2516 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20151223/570e8677/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: application/octet-stream
Size: 177 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20151223/570e8677/attachment.obj>


More information about the pypy-dev mailing list