plasma-umass / scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Apache License 2.0
12.23k stars 399 forks source link

ImportError: dlopen with crdp.abi3.so, 0x0002: bad bind opcode 0x00 #821

Closed ChrisOMills closed 7 months ago

ChrisOMills commented 7 months ago

Looks like an error was introduced for MacOS with version 1.5.40. Running vision 1.5.39 works fine on my Mac with a M3 processor, but 1.5.40 give the following error:

(scs-soc-workflow-py3.12) chrismills@Chriss-MacBook-Pro scs-soc-workflow % scalene
Traceback (most recent call last): File "/Users/chrismills/Library/Caches/pypoetry/virtualenvs/scs-soc-workflow-ypgl0ILn-py3.12/bin/scalene", line 5, in from scalene.main import main File "/Users/chrismills/Library/Caches/pypoetry/virtualenvs/scs-soc-workflow-ypgl0ILn-py3.12/lib/python3.12/site-packages/scalene/main.py", line 4, in from scalene import scalene_profiler File "/Users/chrismills/Library/Caches/pypoetry/virtualenvs/scs-soc-workflow-ypgl0ILn-py3.12/lib/python3.12/site-packages/scalene/scalene_profiler.py", line 82, in from scalene.scalene_json import ScaleneJSON File "/Users/chrismills/Library/Caches/pypoetry/virtualenvs/scs-soc-workflow-ypgl0ILn-py3.12/lib/python3.12/site-packages/scalene/scalene_json.py", line 17, in from scalene.crdp import rdp ImportError: dlopen(/Users/chrismills/Library/Caches/pypoetry/virtualenvs/scs-soc-workflow-ypgl0ILn-py3.12/lib/python3.12/site-packages/scalene/crdp.abi3.so, 0x0002): bad bind opcode 0x00

Discussed in https://github.com/plasma-umass/scalene/discussions/820

Originally posted by **fmamud** April 29, 2024 Hello, trying to use scalene to profile my python 3.11 applications, but I'm facing an issue with it. Could you help me detected what could be wrong ? Many thanks. ``` λ ~/ python3 -m scalene -h Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/Users/fmamud/.pyenv/versions/3.11.1/lib/python3.11/site-packages/scalene/__main__.py", line 4, in from scalene import scalene_profiler File "/Users/fmamud/.pyenv/versions/3.11.1/lib/python3.11/site-packages/scalene/scalene_profiler.py", line 82, in from scalene.scalene_json import ScaleneJSON File "/Users/fmamud/.pyenv/versions/3.11.1/lib/python3.11/site-packages/scalene/scalene_json.py", line 17, in from scalene.crdp import rdp ImportError: dlopen(/Users/fmamud/.pyenv/versions/3.11.1/lib/python3.11/site-packages/scalene/crdp.abi3.so, 0x0002): bad bind opcode 0x00 ``` OS info: ``` λ ~/ sw_vers ProductName: macOS ProductVersion: 14.4.1 BuildVersion: 23E224 ```
ogencoglu commented 7 months ago

Same here

jaltmayerpizzorno commented 7 months ago

I'm looking into this... I've been seeing this dlopen error for MacOS >14.2.1...

sternj commented 7 months ago

We've seen this problem on the CI pipeline too but haven't yet been able to reproduce it locally, @ogencoglu what CPU and OS are you on?

sternj commented 7 months ago

I also have seen this documented in very very few places, one of the only others is in an issue report in the LIEF project

ogencoglu commented 7 months ago

We've seen this problem on the CI pipeline too but haven't yet been able to reproduce it locally, @ogencoglu what CPU and OS are you on?

MacBook Pro M2

jaltmayerpizzorno commented 7 months ago

As it turns out, the issue is that you need Xcode >= 15.3 when running on MacOS > 14.2, and that's not default on the GitHub runners. I'll make a new release for this fix.