samba-documents-provider icon indicating copy to clipboard operation
samba-documents-provider copied to clipboard

Crashes on Lollipop devices

Open ttanxu opened this issue 9 years ago • 7 comments

Lots of feedback on crashes on Lollipop devices.

ttanxu avatar Jul 07 '17 21:07 ttanxu

Stacktrace:

04-10 02:17:06.659 8928-8990/? E/AndroidRuntime: FATAL EXCEPTION: Thread-397
                                                 Process: com.google.android.sambadocumentsprovider, PID: 8928
                                                 java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "state_path" referenced by "libsmbregistry-samba4.so"...
                                                     at java.lang.Runtime.loadLibrary(Runtime.java:371)
                                                     at java.lang.System.loadLibrary(System.java:988)
                                                     at com.google.android.sambadocumentsprovider.nativefacade.NativeCredentialCache.<clinit>(NativeCredentialCache.java:23)
                                                     at com.google.android.sambadocumentsprovider.nativefacade.SambaMessageLooper.prepare(SambaMessageLooper.java:71)
                                                     at com.google.android.sambadocumentsprovider.nativefacade.SambaMessageLooper.access$000(SambaMessageLooper.java:24)
                                                     at com.google.android.sambadocumentsprovider.nativefacade.SambaMessageLooper$1.run(SambaMessageLooper.java:29)
                                                     at java.lang.Thread.run(Thread.java:818)

ttanxu avatar Jul 07 '17 21:07 ttanxu

state_path is defined in libsmbconf.so, but it needs libsmbregsitry-samba4.so.

ttanxu avatar Jul 08 '17 19:07 ttanxu

I am calling this bug fix infeasible.

I tried to untie the circular dependencies, only to reveal more circular dependencies.

I made samba3util subsystem which defines state_path a shared library. Then I found symbols in param subsystem depends on smbconf a library and smbconf depends on param.

Given that I am not an expert in Samba, I feel keep untying circular dependencies will lead to unexpected behaviors.

Lollipop users don't be too sad. Lollipop cannot benefit from this app much because the only thing their users could do with this app if it ran was to pick files in Samba servers while sending an email.

ttanxu avatar Jul 08 '17 23:07 ttanxu

FWIW, configuring samba with

          --with-static-modules=ALL \
          --builtin-libraries=replace,ccan,samba-cluster-support,smbconf,smbregistry,secrets3 \
          --bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent

Seems to get rid of the circular dependencies. Tested with SPMC on FireTV (API22).

Thanks for the patch, BTW 👍

koying avatar Jul 26 '17 17:07 koying

Thanks for @koying's effort and I believe you've tried several combinations before making it work.

Unlike SPMC this app is relying on Storage Access Framework. I believe releasing a patch for Lollipop users is not very useful as SAF was not very useful for L.

ttanxu avatar Jul 26 '17 19:07 ttanxu

Actually, the most difficult part is to make any sense of these options... which I still don't, honestly. Purely empirical, I must admit, based only on the libs having the duplicate symbols the linker complained about ;)

Re usefulness, I guess, you're probably right for SAF, but could be useful for any app needing samba on droid, I suppose. I bet you'll see many file explorers upgraded to slb2/smb3 based on your work, soon, considering the based press smb1 git those last months...

koying avatar Jul 26 '17 20:07 koying

#52 i meet the same question and i use ndk 12b to create the toolchain ,now it can run on android-l

samonkey-zouyingjun avatar Mar 12 '18 09:03 samonkey-zouyingjun