Skip to content

test_socket testFDPassEmpty fails on OS X 10.11+ with "Cannot allocate memory" #68913

Description

@ned-deily
BPO 24725
Nosy @ronaldoussoren, @vstinner, @ned-deily
PRs
  • bpo-24725: Skip the test_socket.testFDPassEmpty on OS X. #1427
  • Files
  • issue-24725.patch
  • repro.c
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ned-deily'
    closed_at = None
    created_at = <Date 2015-07-26.07:35:31.721>
    labels = ['OS-mac', '3.8', '3.9', '3.10']
    title = 'test_socket testFDPassEmpty fails on OS X 10.11+ with "Cannot allocate memory"'
    updated_at = <Date 2021-11-30.16:44:35.098>
    user = 'https://github.com/ned-deily'

    bugs.python.org fields:

    activity = <Date 2021-11-30.16:44:35.098>
    actor = 'ronaldoussoren'
    assignee = 'ned.deily'
    closed = False
    closed_date = None
    closer = None
    components = ['macOS']
    creation = <Date 2015-07-26.07:35:31.721>
    creator = 'ned.deily'
    dependencies = []
    files = ['41069', '49528']
    hgrepos = []
    issue_num = 24725
    keywords = ['patch']
    message_count = 10.0
    messages = ['247414', '247416', '254848', '257153', '257154', '284474', '292893', '301916', '379009', '407385']
    nosy_count = 6.0
    nosy_names = ['ronaldoussoren', 'vstinner', 'baikie', 'ned.deily', 'python-dev', 'jramnani']
    pr_nums = ['1427']
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue24725'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Linked PRs

    Activity

    1. ned-deily commented on Jul 26, 2015

      @ned-deily
      MemberAuthor

      ======================================================================
      ERROR: testFDPassEmpty (test.test_socket.RecvmsgSCMRightsStreamTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_socket.py", line 2799, in testFDPassEmpty
          len(MSG), 10240),
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_socket.py", line 1907, in doRecvmsg
          result = sock.recvmsg(bufsize, *args)
      OSError: [Errno 12] Cannot allocate memory

      ======================================================================
      ERROR: testFDPassEmpty (test.test_socket.RecvmsgIntoSCMRightsStreamTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_socket.py", line 2799, in testFDPassEmpty
          len(MSG), 10240),
        File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_socket.py", line 1998, in doRecvmsg
          result = sock.recvmsg_into([buf], *args)
      OSError: [Errno 12] Cannot allocate memory

      Ran 507 tests in 28.819s

      FAILED (errors=2, skipped=122)
      test test_socket failed

      Same failures seen with 3.4.3 and 3.5.0b4 installers on 10.11 (El Capitan) Developer Previews 2 and 4. Passes on 10.10.x and earlier recent OS X systems. There have been other problems in this area on OS X in the past (see bpo-12958). Probably need to open a RADAR.

    2. ronaldoussoren commented on Jul 26, 2015

      @ronaldoussoren
      Contributor

      I agree this needs a radar when it works on older releases of the OS and not on the 10.11 beta's.

    3. jramnani commented on Nov 18, 2015

      jramnanimannequin
      Mannequin

      I'm still getting these test failures on OS X 10.11.1. Has a radar been filed with Apple? I'd submit one, but I don't know enough about the issue to create a good bug report.

      In the meantime, I'm attaching a patch to skip these tests as was done in issue bpo-12958.

    4. python-dev commented on Dec 29, 2015

      python-devmannequin
      Mannequin

      New changeset b4c6631737b3 by Brett Cannon in branch 'default':
      Issue bpo-24725: Skip the test_socket.testFDPassEmpty on OS X.
      https://hg.python.org/cpython/rev/b4c6631737b3

    5. brettcannon commented on Dec 29, 2015

      @brettcannon
      Member

      Thanks for the patch, Jeff!

    6. ned-deily commented on Jan 2, 2017

      @ned-deily
      MemberAuthor

      This issue slipped off the radar (so to speak) after being closed. For one, the tests also fail on 3.5.x (and probably earlier systems) and fail on macOS 10.12, not just 10.11. And, two, I'm not sure if anyone opened an issue with Apple about it. I'm re-opening it and assigning it to me to address those things.

    7. changed the title [-]test_socket testFDPassEmpty fails on OS X 10.11 DP with "Cannot allocate memory"[/-] [+]test_socket testFDPassEmpty fails on OS X 10.11+ with "Cannot allocate memory"[/+] on Jan 2, 2017
    8. self-assigned this
      on Jan 2, 2017
    9. vstinner commented on May 3, 2017

      @vstinner
      Member

      New changeset 5e9c110 by Victor Stinner in branch '3.5':
      bpo-24725: Skip the test_socket.testFDPassEmpty on OS X (bpo-1427)
      5e9c110

    10. vstinner commented on Sep 11, 2017

      @vstinner
      Member

      Ned Deily:

      This issue slipped off the radar (so to speak) after being closed. For one, the tests also fail on 3.5.x (and probably earlier systems) and fail on macOS 10.12, not just 10.11. And, two, I'm not sure if anyone opened an issue with Apple about it. I'm re-opening it and assigning it to me to address those things.

      Did you report the bug to Apple? Any update? Should we just close the issue?

    11. ronaldoussoren commented on Oct 19, 2020

      @ronaldoussoren
      Contributor

      The issue is still present with python 3.9 and macOS 10.15 as well as current macOS 11 betas.

      The following python scriptlet reproduces the issue:

      # ---

      import socket
        
      sd1, sd2 = socket.socketpair()

      sd1.sendmsg([b"hello"], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, b"")])
      sd2.recvmsg(1)
      # ---

      I think the attached file "repro.c" does the same in C, it also fails with "recvmsg: Cannot allocate memory".

      I've filed an issue for this with Apple: FB8813140. I filed it from an Arm Mac system, with some luck this will help to get attention :-)

    12. ronaldoussoren commented on Nov 30, 2021

      @ronaldoussoren
      Contributor

      The reproducer script and .c file I added earlier do not fail with "Cannot allocate memory" on macOS 12.0.1.

      I haven't checked yet if this is enough to avoid test failures in the (now skipped) testFDPassEmpty.

    13. transferred this issue fromon Apr 10, 2022
    14. ronaldoussoren commented on Dec 7, 2023

      @ronaldoussoren
      Contributor

      This issue appears to be fixed in macOS 14 (haven't check macOS 13), tests pass without problems if I revert #1427 locally.

      My current plan is to test on macOS 13 as well and then create a PR that replaces the skip on macOS by requires_mac_ver(14) or requires_mac_ver(13) depending on the result.

    15. vstinner commented on Dec 7, 2023

      @vstinner
      Member

      This issue appears to be fixed in macOS 14 (haven't check macOS 13), tests pass without problems if I revert #1427 locally.

      You can use @support.requires_mac_ver() decorator.

    16. removed their assignment
      on Oct 2, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions