<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE type=text/css>
BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css>
body {border-width:0;margin:0}
img {border:0;margin:0;padding:0}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.10240.16603"></HEAD>
<BODY 
style="BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 10.5pt; FONT-FAMILY: 微软雅黑; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; COLOR: #000000; MARGIN: 12px; LINE-HEIGHT: 1.5; BORDER-TOP-WIDTH: 0px" 
marginheight="0" marginwidth="0"><STATIONERY>
<DIV>Hello devs,</DIV>
<DIV> </DIV>
<DIV>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)</DIV>
<DIV> </DIV>
<DIV><STRONG>Reproduce</STRONG>:</DIV>
<DIV> </DIV>
<DIV>First install python-daemon:</DIV>
<DIV>pypy_pip install python-daemon</DIV>
<DIV> </DIV>
<DIV>Use the following test script (also available in attachment):</DIV>
<DIV> </DIV>
<DIV>#!/usr/bin/pypy<BR>import daemon<BR>import multiprocessing<BR>def 
test():<BR>    q = multiprocessing.Queue(64)<BR>if __name__ == 
'__main__':<BR>    with 
daemon.DaemonContext():<BR>        
test()</DIV>
<DIV> </DIV>
<DIV>When executing the script with pypy:</DIV>
<DIV>pypy test.py</DIV>
<DIV> </DIV>
<DIV>The background service does not exit, and is consuming 100% CPU:</DIV>
<DIV>ps aux | grep pypy<BR>root      7769 99.1  
0.5 235332 46812 ?        R    
17:52   2:09 pypy test.py<BR>root      
7775  0.0  0.0 103252   804 pts/1    
S+   17:54   0:00 grep pypy</DIV>
<DIV> </DIV>
<DIV><IMG src="cid:flashmail$8TlfA6yG$1450865004__0@nmmp"></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Executing the script with python:</DIV>
<DIV>python2.7 test.py</DIV>
<DIV>And the background service normally exits.</DIV>
<DIV> </DIV>
<DIV><STRONG>Environment:</STRONG></DIV>
<DIV>I'm using CentOS 6.5, with portable PyPy distribution for linux (<A 
href="https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-4.0.1-linux_x86_64-portable.tar.bz2">https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-4.0.1-linux_x86_64-portable.tar.bz2</A>)</DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<DIV>Please contact if you have any questions or ideas.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; COLOR: #c0c0c0">
<DIV align=left>2015-12-23</DIV>
<HR id=SignNameHR 
style="BORDER-TOP: #c0c0c0 1px solid; HEIGHT: 1px; BORDER-RIGHT: 0px; WIDTH: 122px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px" 
align=left>
<SPAN id=_FlashSignName>hubo</SPAN> </DIV></STATIONERY></BODY></HTML>