compiler-benchmark icon indicating copy to clipboard operation
compiler-benchmark copied to clipboard

./benchmark --languages=C++ fails: `AttributeError: 'Process' object has no attribute '_cache'`

Open timotheecour opened this issue 3 years ago • 3 comments

pip3 install psutil Collecting psutil Downloading psutil-5.8.0-cp39-cp39-macosx_10_9_x86_64.whl (236 kB) |████████████████████████████████| 236 kB 1.6 MB/s Installing collected packages: psutil Successfully installed psutil-5.8.0

python3 --version Python 3.9.4

./benchmark --languages=C++
# Code-generation:
- Generating generated/c++/main.c++ took 0.135 seconds (C++)
- Generating generated/c++/main_t.c++ took 0.135 seconds (C++)

# Benchmark:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/psutil/_common.py", line 447, in wrapper
    ret = self._cache[fun]
AttributeError: 'Process' object has no attribute '_cache'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/psutil/_common.py", line 447, in wrapper
    ret = self._cache[fun]
AttributeError: _cache

During handling of the above exception, another exception occurred:

timotheecour avatar Apr 24 '21 05:04 timotheecour

a similar issue https://github.com/giampaolo/psutil/issues/1765

And https://github.com/giampaolo/psutil/issues/1826

It seems that psutils doesn't have full features on Macos.

ringabout avatar Apr 24 '21 05:04 ringabout

I received this once on Linux.Python 3.9.5 (default, Nov 23 2021, 15:27:38) . It originated from the _logger.debug line below.

```

for p in psutil.process_iter(attrs=('pid', 'ppid', 'exe', 'cmdline')): if 'ssh' == p.name(): _logger.debug(f"{p.pid} {p.ppid()} {p.exe()} {p.cmdline()}")

uname -a
Linux vncbridge.usnan.org 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu-Server 20.04.3 LTS amd64 customized using Cubic on 2021-10-21 16:47"

[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.__version__
'5.9.2'

Gerardwx avatar Sep 15 '22 16:09 Gerardwx

I unfortunately not have resources to test on more than recent stable Ubuntu. PRs are always welcome.

nordlow avatar Sep 15 '22 19:09 nordlow

I'm closing this for now.

nordlow avatar Feb 01 '24 18:02 nordlow