Skip to content

[BUG] "__emutls_get_address" related crash #1606

Closed

Description

@juha-h

Description

I built ffmpeg libraries using ffmpeg-kit https://github.com/tanersener/ffmpeg-kit master version and then added many of the built libraries (including libavutils.so) to my Android app (baresip+). Immediately when I start baresip+ it crashes with error message:

11-13 11:18:09.442 23890 23890 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~VV5up2PFDWp5FVE4Nd4CIA==/com.tutpro.baresip.plus-OoB1CvZdgkOqYxE_nLSsvQ==/base.apk!/lib/arm64-v8a/libavutil.so"...

Everything works fine when I build ffmpeg libaries with ndk version 23.0.7599858.

Environment Details

  • NDK Version: 23.1.7779620 from Android SDK bundle
  • Build system: toolchain build with API level 24, Android target architecture arm64-v8a, target aarch64-linux-android, machine architecture armv8-a.
  • Host OS: Debian 11
  • ABI: arm64-v8a
  • NDK API level: 24
  • Device API level: 30

Activity

  1. DanAlbert commented on Nov 15, 2021

    @DanAlbert
    Contributor

    Thanks. Looks like build instructions are in their readme: https://github.com/tanersener/ffmpeg-kit#6-build-scripts

    and then added many of the built libraries (including libavutils.so) to my Android app (baresip+)

    Without a repro case the only tool we have at our disposal is using readelf on the ffmpeg binaries. If that's not sufficient we probably can't do anything without a repro case.

  2. juha-h commented on Nov 15, 2021

    @juha-h
    Author

    Yes, and I use this command to make the build:

            cd ffmpeg-kit && \
    	ANDROID_SDK_ROOT=/foo/bar \
    	ANDROID_NDK_ROOT=/opt/Android/ndk/23.1.7779620 \
    	./android.sh --enable-gpl --no-archive \
    		 --disable-arm-v7a --disable-arm-v7a-neon --disable-x86 \
    		--disable-x86-64 \
    		--enable-libvpx --enable-x264 --enable-x265 --enable-libaom \
    		--enable-libpng --skip-ffmpeg-kit
    

    My baresip+ app is open source (https://github.com/juha-h/baresip-studio/tree/video), but is depends on lots of libraries. If it helps, I can create for you an apk of it, where the crash happens at start.

  3. juha-h commented on Nov 15, 2021

    @juha-h
    Author

    The generated lib where the crash happens is here https://box.tutpro.com/tmp/libavutil.so.

  4. juha-h commented on Jan 2, 2022

    @juha-h
    Author

    The crash was gone after I added ndkVersion = '23.1.7779620' to app'd build.gradle. Looks like Android Studio chose an older version of NDK if not explicitly specified.

  5. DanAlbert commented on Jan 4, 2022

    @DanAlbert
    Contributor

    AGP has a default version it uses that is whatever it was tested with. It will never auto-upgrade you (except when you upgrade AGP) because newer NDKs are not always compatible with older AGPs, and non-reproducible builds are a pain :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions