Summary: | sysutils/py-psutil Process broken on 12.0+ i386 | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Antoine Brodin <antoine> |
Component: | Individual Port(s) | Assignee: | Po-Chuan Hsieh <sunpoet> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | Flags: | bugzilla:
maintainer-feedback?
(sunpoet) |
Priority: | --- | ||
Version: | Latest | ||
Hardware: | i386 | ||
OS: | Any |
Description
Antoine Brodin
2019-12-10 13:44:29 UTC
More details with py-psutil built with debug on: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/psutil/__init__.py", line 447, in __init__ self._init(pid) File "/usr/local/lib/python3.6/site-packages/psutil/__init__.py", line 474, in _init self.create_time() File "/usr/local/lib/python3.6/site-packages/psutil/__init__.py", line 824, in create_time self._create_time = self._proc.create_time() File "/usr/local/lib/python3.6/site-packages/psutil/_psbsd.py", line 556, in wrapper return fun(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/psutil/_psbsd.py", line 732, in create_time return self.oneshot()[kinfo_proc_map['create_time']] File "/usr/local/lib/python3.6/site-packages/psutil/_psbsd.py", line 556, in wrapper return fun(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/psutil/_common.py", line 343, in wrapper return fun(self) File "/usr/local/lib/python3.6/site-packages/psutil/_psbsd.py", line 611, in oneshot ret = cext.proc_oneshot_info(self.pid) SystemError: NULL object passed to Py_BuildValue This patch seems to help: --- psutil/_psutil_bsd.c.orig 2019-11-20 08:39:49 UTC +++ psutil/_psutil_bsd.c @@ -271,7 +271,11 @@ psutil_proc_oneshot_info(PyObject *self, PyObject *arg // Return a single big tuple with all process info. py_retlist = Py_BuildValue( +#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031 + "(lillllllLdllllddddlllllbO)", +#else "(lillllllidllllddddlllllbO)", +#endif #ifdef PSUTIL_FREEBSD // (long)kp.ki_ppid, // (long) ppid @@ -285,7 +289,7 @@ psutil_proc_oneshot_info(PyObject *self, PyObject *arg (long)kp.ki_groups[0], // (long) effective gid (long)kp.ki_svuid, // (long) saved gid // - kp.ki_tdev, // (int) tty nr + kp.ki_tdev, // (int or long long) tty nr PSUTIL_TV2DOUBLE(kp.ki_start), // (double) create time // ctx switches kp.ki_rusage.ru_nvcsw, // (long) ctx switches (voluntary) A commit references this bug: Author: sunpoet Date: Thu Dec 12 13:48:33 UTC 2019 New revision: 519924 URL: https://svnweb.freebsd.org/changeset/ports/519924 Log: Fix Process on 12.0+ i386 - Bump PORTREVISION for package change FreeBSD 12.0+ change ki_tdev from 32 bits to 64 bits. PR: 242543 Submitted by: antoine Changes: head/sysutils/py-psutil/Makefile head/sysutils/py-psutil/files/ head/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c FYI, it has been merged upstream. Thanks! [1] https://github.com/giampaolo/psutil/pull/1646 |