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

[PPC64LE buildbots] test_socket: VSOCK testStream(): recv fails with EACCES on Fedora 41 #128116

Closed
encukou opened this issue Dec 20, 2024 · 5 comments

Comments

@encukou
Copy link
Member

encukou commented Dec 20, 2024

Example of failure: https://buildbot.python.org/#/builders/1467/builds/303/steps/6/logs/stdio

Traceback (most recent call last):
  File ".../Lib/test/test_socket.py", line 550, in testStream
    msg = self.conn.recv(1024)
PermissionError: [Errno 13] Permission denied

See also: #119461 (cc @vstinner)

Linked PRs

@vstinner vstinner changed the title test_socket: VSOCK testStream(): recv fails with EACCES on Fedora 41 [PPC64LE buildbots] test_socket: VSOCK testStream(): recv fails with EACCES on Fedora 41 Dec 20, 2024
@vstinner
Copy link
Member

I failed to reproduce the issue. I connected to the PPC64LE Fedora Stable buildbot, I built Python and ran:

./python -m test test_socket -m testStream -v

I tried as the vstinner user, and as the buildbot user: the test succeed in both cases.

@vstinner
Copy link
Member

Some logs on the buildbot:

vstinner@localhost:~/python/3.13$ ls -l /dev/vsock
crw-rw-rw-. 1 root root 10, 60 Dec 18 21:14 /dev/vsock

vstinner@localhost:~/python/3.13$ cat x.py 
import socket
import fcntl
import struct


def get_cid():
    if fcntl is None:
        print("a")
        return None
    if not hasattr(socket, 'IOCTL_VM_SOCKETS_GET_LOCAL_CID'):
        print("b")
        return None
    try:
        with open("/dev/vsock", "rb") as f:
            r = fcntl.ioctl(f, socket.IOCTL_VM_SOCKETS_GET_LOCAL_CID, "    ")
    except OSError as exc:
        print("c", exc)
        return None
    else:
        return struct.unpack("I", r)[0]

print("CID", get_cid())

vstinner@localhost:~/python/3.13$ ./python x.py 
CID 4294967295

@vstinner
Copy link
Member

vstinner commented Dec 20, 2024

Last success, Fedora 40 with glibc 2.39: https://buildbot.python.org/#/builders/90/builds/5363/

os.uname: posix.uname_result(sysname='Linux', nodename='localhost.localdomain', release='5.8.17-200.fc32.ppc64le', version='#1 SMP Thu Oct 29 18:00:08 UTC 2020', machine='ppc64le')
platform.freedesktop_os_release[NAME]: Fedora Linux
platform.freedesktop_os_release[VERSION]: 40 (Server Edition)
platform.libc_ver: glibc 2.39
platform.platform: Linux-5.8.17-200.fc32.ppc64le-ppc64le-with-glibc2.39

First error, Fedora 41 with glibc 2.40: https://buildbot.python.org/#/builders/90/builds/5364/

os.uname: posix.uname_result(sysname='Linux', nodename='localhost.localdomain', release='5.8.17-200.fc32.ppc64le', version='#1 SMP Thu Oct 29 18:00:08 UTC 2020', machine='ppc64le')
platform.freedesktop_os_release[NAME]: Fedora Linux
platform.freedesktop_os_release[VERSION]: 41 (Server Edition)
platform.libc_ver: glibc 2.40
platform.platform: Linux-5.8.17-200.fc32.ppc64le-ppc64le-with-glibc2.40

@vstinner
Copy link
Member

vstinner commented Dec 20, 2024

I wrote PR gh-128120 to skip the test is recv() fails with EACCESS.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 20, 2024
…or (pythonGH-128120)

(cherry picked from commit cbfe302)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner
Copy link
Member

Fixed by change cbfe302. The backport to 3.13 will follow.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 20, 2024
…or (pythonGH-128120)

(cherry picked from commit cbfe302)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue Dec 20, 2024
…ror (GH-128120) (#128123)

gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120)
(cherry picked from commit cbfe302)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue Dec 20, 2024
…ror (GH-128120) (#128124)

gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120)
(cherry picked from commit cbfe302)

Co-authored-by: Victor Stinner <vstinner@python.org>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants