Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cannot locate symbol "_Unwind_GetTextRelBase" - x64 emulator #1

Open
shubham0204 opened this issue Jul 30, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@shubham0204
Copy link
Owner

shubham0204 commented Jul 30, 2024

An application using the library crashes on an x64 emulator with the following error:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Unwind_GetTextRelBase" referenced by "/data/app/.../base.apk!/lib/x86_64/libhftokenizer.so"...

On examining the libhftokenizer.so carefully (with ldd), we notice the following dependency:

$> ldd libhftokenizer.so
        linux-vdso.so.1 (0x00007ffeac3b8000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff4a44db000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff4a4ada000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff4a43fc000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff4a43dc000)
  • The symbol seems to originate from libgcc_s.so which is a shared runtime library for GCC. (see this answer on SO)
  • Removal of libgcc_s.so as a dependency OR packaging libhftokenizer as a static library should solve the issue

References:

  1. https://stackoverflow.com/a/76095789/13546426
  2. https://stackoverflow.com/a/58565529/13546426

The issue was discovered by @greenrobot

@shubham0204 shubham0204 self-assigned this Jul 30, 2024
@shubham0204 shubham0204 added the bug Something isn't working label Jul 30, 2024
@shubham0204
Copy link
Owner Author

Converting a static library may result in the application not loading the jniLibs/<arch>/libhftokenizer.a as Android does not package the static libraries in the APK. A possible workaround could be downloading the static libraries from a remote source or copying them to the local file-system from the assets folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant