Closed Huite closed 2 years ago
0d1a3fd523d6e191b74874ba1e83757994ddf736 introduces the following lines in scooby.knowledge
:
if psutil:
# Code by https://stackoverflow.com/a/35291824/10504481
my_path = str(Path(__file__).resolve())
best_match = ""
FILESYSTEM_TYPE = ""
for part in psutil.disk_partitions():
if my_path.startswith(part.mountpoint) and len(best_match) < len(part.mountpoint):
FILESYSTEM_TYPE = part.fstype
best_match = part.mountpoint
else:
FILESYSTEM_TYPE = False
Turns out this is sufficient to segfault:
import psutil
psutil.disk_partitions()
I'll try some other Python versions on Windows as well.
Python 3.9.9 also crashes for me.
Downgrading psutil from 5.8.0 to 5.7.3 solves the issue for me.
Opened an issue on psutil repo as well:
Thank you for the thorough investigation and opening the upstream issue!
This seems very problematic and I'd like to get a patch in for this ASAP.
I may just add a check for windows after v5.7 to avoid calling the function that seg faults. Do you think that'd be okay?
I may just add a check for windows after v5.7 to avoid calling the function that seg faults. Do you think that'd be okay?
That's probably our best bet until this is fixed in psutil
.
I just came home from the office, figured I'd have another look: I no longer get the segfault.
Looks like it's due to having a certain USB plugged in: https://github.com/giampaolo/psutil/issues/1953
PR is already merged: https://github.com/giampaolo/psutil/pull/1962
EDIT: on the other hand: https://github.com/giampaolo/psutil/issues/2003
Avoiding disk_partitions
on Windows seems like a good idea for now.
Coming from: https://github.com/pyvista/pyvista/issues/1961
I get an immediate segfault when importing scooby, versions 0.5.8, 0.5.9, and 0.5.10.
I'll try and see if I can narrow it down a little more.
System information, for completeness (collected with 0.5.7 ^^):