Charles-François Natali <neolo...@free.fr> added the comment: Looking at the strace output: Successful test: sendmsg(11, {msg_name(0)=NULL, msg_iov(1)=[{"\267", 1}], msg_controllen=16, {cmsg_len=16, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {7}}, msg_flags=0}, 0) = 1
The FD sent is 7 ({7} field), which makes sense. Unsuccessful test: sendmsg(11, {msg_name(0)=NULL, msg_iov(1)=[{"\0", 1}], msg_controllen=16, {cmsg_len=16, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {263}}, msg_flags=0}, 0) = -1 EBADF (Bad file descriptor) See the FD sent is 263? 263 == 0x107, which means that the lower bit of the second byte corresponding the FD hasn't been set: this is exactly the bug fixed by http://hg.python.org/cpython/rev/d4d9a3e71897 (see http://bugs.python.org/msg142627). So this should definitely be fixed in current 2.7. If you confirm it is fixed, then we can close this bug report. Now, you might wonder why this worked with 2.6.6 and 2.7. I think it's mere luck: if we're lucky and CMSG_DATA(cmsg) refers to a memory location which happens to be zero-filled, it'll work. If not, it'll break. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13625> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com