swiftlang / swiftlang/swift-corelibs-libdispatch

[SR-6504] libdispatch.so symbol not found in android

Open
#665 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Android bug libdispatch
Dominant language
C
Stars
2.6k
Forks
496
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Previous ID SR-6504
Radar None
Original Reporter amraboelela (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug, Android
Assignee None
Priority Medium

md5: 7fe497740fe239a09fe9cb6daa9a5a05

Issue Description:

I got this error while trying to run an app linking libfoundation and libdispatch

dlopen failed: cannot locate symbol "__atomic_fetch_add_4" referenced by "/data/app/com.example.addswift-1/lib/arm/libdispatch.so

Full error:

11-29 15:59:36.788 2983-2983/com.example.addswift E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.addswift, PID: 2983
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__atomic_fetch_add_4" referenced by "/data/app/com.example.addswift-1/lib/arm/libdispatch.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:977)
at java.lang.System.loadLibrary(System.java:1530)
at com.example.addswift.MainActivity.<clinit>(MainActivity.java:43)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the Android app's native library load and inspect how libdispatch.so is built and linked; done means the reported __atomic_fetch_add_4 symbol error no longer occurs when the app loads libdispatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
mobile-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.