scalene icon indicating copy to clipboard operation
scalene copied to clipboard

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

Open ChrisOMills opened this issue 1 year ago • 1 comments

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 "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/fmamud/.pyenv/versions/3.11.1/lib/python3.11/site-packages/scalene/__main__.py", line 4, in <module>
    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 <module>
    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 <module>
    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
```</div>

ChrisOMills avatar Apr 30 '24 22:04 ChrisOMills

Same here

ogencoglu avatar May 01 '24 21:05 ogencoglu

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

jaltmayerpizzorno avatar May 02 '24 18:05 jaltmayerpizzorno

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 avatar May 02 '24 18:05 sternj

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

sternj avatar May 02 '24 18:05 sternj

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

ogencoglu avatar May 02 '24 18:05 ogencoglu

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.

jaltmayerpizzorno avatar May 03 '24 15:05 jaltmayerpizzorno