Skip to content

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

@shubham0204

Description

@shubham0204

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions