[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC

2013-10-30 Thread Robert Merrill
Robert Merrill added the comment: I'm adding Library again because I think the current behavior is a bug and should be fixed in the 2.7 tree. Perhaps the documentation in older versions should be updated mmap.mmap should always set the FD_CLOEXEC flag on the descriptor that it gets from dup

[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC

2013-10-30 Thread Robert Merrill
Robert Merrill added the comment: Sorry, I correct my earlier statement: even if the fd you pass to mmap.mmap() is set to FD_CLOEXEC, the dup'd fd /will not be/ So this is a REALLY bad bug because users cannot workaround it except by just not using mmap

[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC

2013-10-29 Thread Robert Merrill
New submission from Robert Merrill: Same code but different problem as this issue: http://bugs.python.org/issue10897 The above-linked issue was closed as WONTFIX, but there is a secondary problem: the file descriptor that mmap.mmap() allocates is not set to close-on-exec. This means that any

[issue19444] mmap.mmap() allocates a file descriptor that isn't CLOEXEC

2013-10-29 Thread Robert Merrill
Robert Merrill added the comment: I should add a caveat: the fd that is created by mmap /will/ be set to close-on-exec if the fd you passed in was. But even if it's not, I see no reason why mmap should not be setting it anyway. At the very least, the documentation should bring the user's