[pypy-dev] Patches for Pypy under cygwin

Uwe F. Mayer uwe_f_mayer at yahoo.com
Fri Jun 8 02:01:25 CEST 2012


As requested, I ran the code with strace. More precisely, I ran from the pypy/pypy/translator/goal/ directory the command:
strace sh -c 'pypy-c /d/pypy/test_os_fork.py'
I ran this twice, once with a version of pypy built with "--opt=2", and once with with a version of pypy built with "--opt=jit". The "--opt=2" version succeeds, and the "--opt=jit" version fails, as reported earlier.
Attached you'll find the test_os_fork.py script, and the two log files cut down to the relevant part. The log is a couple of MB, I cut it down to the relevant section. 
I don't know the answers the other two questions.

The third question may touch the core of the issue if the JIT marks the (parent) memory as exclusive access before the fork() call, which would be consistent with the observed error. From what I can tell the fork() call never gets off the ground, having no read access to duplicate the process image.
--Uwe


________________________________
 From: Amaury Forgeot d'Arc <amauryfa at gmail.com>
To: Uwe F. Mayer <uwe_f_mayer at yahoo.com> 
Cc: Armin Rigo <arigo at tunes.org>; Matti Picus <matti.picus at gmail.com>; "pypy-dev at python.org" <pypy-dev at python.org> 
Sent: Thursday, June 7, 2012 2:24 PM
Subject: Re: [pypy-dev] Patches for Pypy under cygwin
 

2012/6/7 Uwe F. Mayer <uwe_f_mayer at yahoo.com>

3 [main] pypy-c 11788 fixup_mmaps_after_fork: ReadProcessMemory failed for MAP_PRIVATE address 0xB0010000, Win32 error 998
Aha, looks interesting. Searching for this error message, I found that cygwin unblocks the parent process before the child calls "fixup_mmaps_after_fork": http://www.mail-archive.com/cygwin@cygwin.com/msg05547.html
Could you try again with strace?
Does the parent really unmap memory?
Or is it because of the special access rights that the JIT uses to mark the memory as executable?

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120607/1a7a8380/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_os_fork.py
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120607/1a7a8380/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_os_fork_opt=2.log
Type: application/octet-stream
Size: 21270 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120607/1a7a8380/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_os_fork_opt=jit.log
Type: application/octet-stream
Size: 6164 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120607/1a7a8380/attachment-0003.obj>


More information about the pypy-dev mailing list