Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./python.exe -We -m test test_socket fails with 12 warnings on macos #128766

Closed
sobolevn opened this issue Jan 12, 2025 · 1 comment
Closed

./python.exe -We -m test test_socket fails with 12 warnings on macos #128766

sobolevn opened this issue Jan 12, 2025 · 1 comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jan 12, 2025

Bug report

I am not sure about other platforms, but on macos it raises with -We:

======================================================================
ERROR: testSecondCmsgTruncInData (test.test_socket.RecvmsgIntoRFC3542AncillaryUDP6Test.testSecondCmsgTruncInData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 4410, in testSecondCmsgTruncInData
    msg, ancdata, flags, addr = self.doRecvmsg(
                                ~~~~~~~~~~~~~~^
        self.serv_sock, len(MSG),
        ^^^^^^^^^^^^^^^^^^^^^^^^^
        socket.CMSG_SPACE(SIZEOF_INT) + socket.CMSG_LEN(SIZEOF_INT) - 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3007, in doRecvmsg
    result = sock.recvmsg_into([buf], *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testSingleCmsgTruncInData (test.test_socket.RecvmsgIntoRFC3542AncillaryUDP6Test.testSingleCmsgTruncInData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 4306, in testSingleCmsgTruncInData
    msg, ancdata, flags, addr = self.doRecvmsg(
                                ~~~~~~~~~~~~~~^
        self.serv_sock, len(MSG), socket.CMSG_LEN(SIZEOF_INT) - 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3007, in doRecvmsg
    result = sock.recvmsg_into([buf], *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen0 (test.test_socket.RecvmsgIntoSCMRightsStreamTest.testCmsgTruncLen0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3975, in testCmsgTruncLen0
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0), maxdata=0)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3007, in doRecvmsg
    result = sock.recvmsg_into([buf], *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen0Plus1 (test.test_socket.RecvmsgIntoSCMRightsStreamTest.testCmsgTruncLen0Plus1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3983, in testCmsgTruncLen0Plus1
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0) + 1, maxdata=1)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3007, in doRecvmsg
    result = sock.recvmsg_into([buf], *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen1 (test.test_socket.RecvmsgIntoSCMRightsStreamTest.testCmsgTruncLen1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3991, in testCmsgTruncLen1
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(SIZEOF_INT),
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                             maxdata=SIZEOF_INT)
                             ^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3007, in doRecvmsg
    result = sock.recvmsg_into([buf], *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen2Minus1 (test.test_socket.RecvmsgIntoSCMRightsStreamTest.testCmsgTruncLen2Minus1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 4001, in testCmsgTruncLen2Minus1
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(2 * SIZEOF_INT) - 1,
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                             maxdata=(2 * SIZEOF_INT) - 1)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3007, in doRecvmsg
    result = sock.recvmsg_into([buf], *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testSecondCmsgTruncInData (test.test_socket.RecvmsgRFC3542AncillaryUDP6Test.testSecondCmsgTruncInData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 4410, in testSecondCmsgTruncInData
    msg, ancdata, flags, addr = self.doRecvmsg(
                                ~~~~~~~~~~~~~~^
        self.serv_sock, len(MSG),
        ^^^^^^^^^^^^^^^^^^^^^^^^^
        socket.CMSG_SPACE(SIZEOF_INT) + socket.CMSG_LEN(SIZEOF_INT) - 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 2916, in doRecvmsg
    result = sock.recvmsg(bufsize, *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testSingleCmsgTruncInData (test.test_socket.RecvmsgRFC3542AncillaryUDP6Test.testSingleCmsgTruncInData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 4306, in testSingleCmsgTruncInData
    msg, ancdata, flags, addr = self.doRecvmsg(
                                ~~~~~~~~~~~~~~^
        self.serv_sock, len(MSG), socket.CMSG_LEN(SIZEOF_INT) - 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 2916, in doRecvmsg
    result = sock.recvmsg(bufsize, *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen0 (test.test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3975, in testCmsgTruncLen0
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0), maxdata=0)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 2916, in doRecvmsg
    result = sock.recvmsg(bufsize, *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen0Plus1 (test.test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen0Plus1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3983, in testCmsgTruncLen0Plus1
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0) + 1, maxdata=1)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 2916, in doRecvmsg
    result = sock.recvmsg(bufsize, *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen1 (test.test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3991, in testCmsgTruncLen1
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(SIZEOF_INT),
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                             maxdata=SIZEOF_INT)
                             ^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 2916, in doRecvmsg
    result = sock.recvmsg(bufsize, *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

======================================================================
ERROR: testCmsgTruncLen2Minus1 (test.test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen2Minus1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 72, in wrapper
    return f(*args, **kwds)
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 4001, in testCmsgTruncLen2Minus1
    self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(2 * SIZEOF_INT) - 1,
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                             maxdata=(2 * SIZEOF_INT) - 1)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 3954, in checkTruncatedArray
    msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
                                ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                               len(MSG), ancbuf)
                                               ^^^^^^^^^^^^^^^^^
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_socket.py", line 2916, in doRecvmsg
    result = sock.recvmsg(bufsize, *args)
RuntimeWarning: received malformed or improperly-truncated ancillary data

----------------------------------------------------------------------
Ran 734 tests in 27.351s

FAILED (errors=12, skipped=246)
test test_socket failed
test_socket failed (12 errors)

== Tests result: FAILURE ==

1 test failed:
    test_socket

Total duration: 27.5 sec
Total tests: run=734 skipped=246
Total test files: run=1/1 failed=1
Result: FAILURE
@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Jan 12, 2025
@serhiy-storchaka
Copy link
Member

Looks like duplicate of #68016 and #110012.

@sobolevn sobolevn closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants