classification
Title: test_socket.testRecvmsgTrunc failure on FreeBSD 7.2 buildbot
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: baikie, neologix, python-dev, vstinner
Priority: normal Keywords: needs review, patch

Created on 2011-09-17 14:34 by neologix, last changed 2011-10-03 20:53 by neologix. This issue is now closed.

Files
File name Uploaded Description Edit
freebsd_msgtrunc.diff neologix, 2011-09-17 14:34 review
freebsd_msgtrunc-1.diff neologix, 2011-10-02 16:43 review
requires_unix_version.diff neologix, 2011-10-02 16:43 review
Messages (4)
msg144188 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-09-17 14:34
http://www.python.org/dev/buildbot/all/builders/x86 FreeBSD 7.2 3.x/builds/2129/steps/test/logs/stdio

"""
======================================================================
FAIL: testRecvmsgTrunc (test.test_socket.RecvmsgUDPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1666, in testRecvmsgTrunc
    self.checkFlags(flags, eor=False)
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1354, in checkFlags
    self.assertEqual(flags & mask, checkset & mask)
AssertionError: 0 != 16

======================================================================
FAIL: testRecvmsgTrunc (test.test_socket.RecvmsgIntoUDPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1666, in testRecvmsgTrunc
    self.checkFlags(flags, eor=False)
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_socket.py", line 1354, in checkFlags
    self.assertEqual(flags & mask, checkset & mask)
AssertionError: 0 != 16
"""

This fails because MSG_TRUNC isn't always set in msg_flags when receiving a truncated datagram with recvmsg().
It's a known kernel bug (http://svnweb.freebsd.org/base?view=revision&revision=211030), fixed in FreeBSD 8 (and the test indeed passes on the FreeBSD 8 buildbot).

The patch attached skips the test on FreeBSD < 8 (and introduces @support.requires_freebsd_version).
msg144238 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-09-18 10:10
@requires_freebsd_version should be factorized with @requires_linux_version.

Can we workaround FreeBSD (< 8) bug in C/Python? Or should we remove the function on FreeBSD < 8?
msg144776 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-10-02 16:43
> @requires_freebsd_version should be factorized with
> @requires_linux_version.

Patches attached.

> Can we workaround FreeBSD (< 8) bug in C/Python?

Not really.

> Or should we remove the function on FreeBSD < 8?

There's really no reason to do that (and it's really a minor bug).
msg144826 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-03 17:41
New changeset 4378bae6b8dc by Charles-François Natali in branch 'default':
Issue #13001: Fix test_socket.testRecvmsgTrunc failure on FreeBSD < 8, which
http://hg.python.org/cpython/rev/4378bae6b8dc
History
Date User Action Args
2011-10-03 20:53:21neologixsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2011-10-03 17:41:06python-devsetnosy: + python-dev
messages: + msg144826
2011-10-02 16:43:09neologixsetfiles: + freebsd_msgtrunc-1.diff, requires_unix_version.diff

messages: + msg144776
2011-09-18 20:00:21baikiesetnosy: + baikie
2011-09-18 10:10:26vstinnersetmessages: + msg144238
2011-09-17 14:34:30neologixcreate