-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
mac m1 RuntimeError: proc_pidinfo(PROC_PIDLISTFDS) 2/2 syscall failed #2116
Comments
I could reproduce this on my virtualized osx and it turns out the crash is due |
I'm getting something very similar on my mac m1:
I'm storing the exception in a file because the parent process ( I'm trying to figure out a minimal example. |
Python script to listen to a given port: #!/usr/bin/env python
import socket
import sys
HOST = "0.0.0.0"
PORT = int(sys.argv[1])
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
with conn:
while True:
data = conn.recv(1024)
if data.decode() == "bye":
break
conn.sendall(data)
conn, addr = s.accept() Script that will cause the exception given above if import os
import traceback
from subprocess import Popen
import psutil
from daemon import DaemonContext
cwd = os.getcwd()
port = 51371
nc_cmd = ["/usr/bin/nc", "-l", str(port)]
echo_cmd = ["/Users/horta/code/h3daemon-bug/echo.py", str(port)]
if __name__ == "__main__":
with DaemonContext():
master = Popen(nc_cmd)
# master = Popen(echo_cmd)
x = master.pid
try:
for x in psutil.Process(master.pid).connections(kind="tcp"):
pass
except Exception:
traceback.print_exc(file=open(f"{cwd}/exception.txt", "w")) The bug does not happen without DaemonContext(), python-daemon.
|
Summary
Description
hello all:
my code:
use error:
How can I solve this problem, thanks
The text was updated successfully, but these errors were encountered: