Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

frida-python: import frida fails after upgrading to 14.2.14 #237

Closed
ghost opened this issue May 12, 2021 · 8 comments
Closed

frida-python: import frida fails after upgrading to 14.2.14 #237

ghost opened this issue May 12, 2021 · 8 comments

Comments

@ghost
Copy link

ghost commented May 12, 2021

Problem description
After upgrading frida-python to 14.2.14, import frida fails with following message:

ImportError: dlopen failed: cannot locate symbol "frida_selinux_apply_policy_patch" referenced by "/data/data/com.termux/files/usr/lib/python3.9/site-packages/_frida.so"...

Scripts in frida-tools package (which depends on frida-python) fails with same error.

Steps to reproduce

~ $ python
Python 3.9.2 (default, Feb 22 2021, 12:26:04)
[Clang 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import frida

***
Failed to load the Frida native extension: dlopen failed: cannot locate symbol "frida_selinux_apply_policy_patch" referenced by "/data/data/com.termux/files/usr/lib/python3.9/site-packages/_frida.so"...
Please ensure that the extension was compiled for Python 3.x.
***

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/frida/__init__.py", line 24, in <module>
    raise ex
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/frida/__init__.py", line 7, in <module>
    import _frida
ImportError: dlopen failed: cannot locate symbol "frida_selinux_apply_policy_patch" referenced by "/data/data/com.termux/files/usr/lib/python3.9/site-packages/_frida.so"...
>>>
~ $
~ $ frida-ps

***
Failed to load the Frida native extension: dlopen failed: cannot locate symbol "frida_selinux_apply_policy_patch" referenced by "/data/data/com.termux/files/usr/lib/python3.9/site-packages/_frida.so"...
Please ensure that the extension was compiled for Python 3.x.
***

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/frida-ps", line 10, in <module>
    frida_tools.ps.main()
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/frida_tools/ps.py", line 8, in main
    from frida_tools.application import ConsoleApplication
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/frida_tools/application.py", line 23, in <module>
    import frida
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/frida/__init__.py", line 24, in <module>
    raise ex
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/frida/__init__.py", line 7, in <module>
    import _frida
ImportError: dlopen failed: cannot locate symbol "frida_selinux_apply_policy_patch" referenced by "/data/data/com.termux/files/usr/lib/python3.9/site-packages/_frida.so"...
~ $

Expected behavior
-

Additional information
I believe it's happening because the function name has changed by upstream while the patch in this repository hasn't been updated accordingly.

https://github.com/frida/frida-core/blob/2cb83c81e596cc6a3589bdcdca5fbaf2ba65b672/lib/selinux/patch.c#L59

@Grimler91
Copy link
Member

Thanks for reporting and investigating! Should be fixed in frida 14.2.18, which should be available in ~half an hour as long as the build succeeds

@Grimler91
Copy link
Member

Welp, re-opening. CI build fails with some weird error and local build seem to fail due to arm build requiring ndk 22, so need to spend some time on it.

@Grimler91 Grimler91 reopened this May 13, 2021
@Grimler91
Copy link
Member

Fixed in frida 14.2.14-1

@arjatr
Copy link

arjatr commented Dec 12, 2021

The same thing happens to me with the latest version

@arjatr
Copy link

arjatr commented Dec 12, 2021

Any solution?

@Grimler91
Copy link
Member

@arjatr please open a new issue and fill in the bug report template. I get an error when I try to import frida, but it is totally different from the one in this issue, so yours might be different

@arjatr
Copy link

arjatr commented Dec 12, 2021

@arjatr please open a new issue and fill in the bug report template. I get an error when I try to import frida, but it is totally different from the one in this issue, so yours might be different

is the same
Screenshot_20211212-005938008

@Grimler91
Copy link
Member

You get the same error as me. The error message is completely different from the one in this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants