facebook / pyre2

Python wrapper for RE2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fb-re2 compiles and installs on macos but using gives segmentation fault

ssbarnea opened this issue · comments

While I suspect there is some specific local environment issue that produces this awful result, I think that we need to prevent it from building/installing a broken package.

pip install fb-re2
python -c "import re2; re2.compile('foo')"
[1]    99748 segmentation fault  python -c "import re2; re2.compile('foo')"

I was able to reproduce the error with both python3.6 and pyton3.7 installed using pyenv.

I am ok on Mac 10.15

~/ub16_prj % python -m pip install fb-re2
Collecting fb-re2
Downloading fb-re2-1.0.7.tar.gz (9.4 kB)
Building wheels for collected packages: fb-re2
Building wheel for fb-re2 (setup.py) ... done
Created wheel for fb-re2: filename=fb_re2-1.0.7-cp38-cp38-macosx_10_15_x86_64.whl size=11013 sha256=ca8795ce3f839fbc12a542381fa2f0bc58c1837ff78f3305518f46e3c42d75f5
Stored in directory: /Users/yuanke/Library/Caches/pip/wheels/be/90/07/89f22d55ba4fdb4edd098668479c144735f98cd5a98d35d316
Successfully built fb-re2
Installing collected packages: fb-re2
Successfully installed fb-re2-1.0.7
~/ub16_prj % python -c "import re2; re2.compile('foo')"
~/ub16_prj %

Note: I closed this not because the bug is not valid, but because I stopped using fb-re2. It still happens with 1.0.7 and with py36-py38 for sure. The error is bit different:

$ python3.6 -c "import re2; re2.compile('foo')"                                                                                                   [7:51:11]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/ssbarnea/.pyenv/versions/3.6.10/lib/python3.6/site-packages/re2.py", line 27, in <module>
import _re2
ImportError: dlopen(/Users/ssbarnea/.pyenv/versions/3.6.10/lib/python3.6/site-packages/_re2.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/re2/lib/libre2.0.dylib
Referenced from: /Users/ssbarnea/.pyenv/versions/3.6.10/lib/python3.6/site-packages/_re2.cpython-36m-darwin.so
Reason: image not found