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

FreeBSD: cpu_affinity() segfaults #586

Closed
giampaolo opened this issue Feb 9, 2015 · 1 comment
Closed

FreeBSD: cpu_affinity() segfaults #586

giampaolo opened this issue Feb 9, 2015 · 1 comment

Comments

@giampaolo
Copy link
Owner

user@freebsd9~/psutil$ python3 -c "import psutil; psutil.Process().cpu_affinity(list(range(10000, 11000)))"
Segmentation fault: 11 (core dumped)

This only happens with Python 3. With Python 2 we get ValueError (as supposed to).

@giampaolo
Copy link
Owner Author

Update: it also happens on Python 2 from time to time so there's definitively something wrong with the current implementation.
Also, another problem, in case of invalid CPU we may get NSP (instead of ValueError):

user@freebsd9~/psutil$ python -c "import psutil; psutil.Process().cpu_affinity([199])"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "psutil/__init__.py", line 697, in cpu_affinity
    self._proc.cpu_affinity_set(cpus)
  File "psutil/_psbsd.py", line 229, in wrapper
    raise NoSuchProcess(self.pid, self._name)
psutil.NoSuchProcess: process no longer exists (pid=43037)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant