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

Text relocations and crash in android 6.0 #76

Open
wildfatduck opened this issue Sep 26, 2015 · 25 comments
Open

Text relocations and crash in android 6.0 #76

wildfatduck opened this issue Sep 26, 2015 · 25 comments

Comments

@wildfatduck
Copy link

When decoder library is loaded we have this warning:

W/linker: libaacdecoder.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

But, if we set build target to API 23 and run this app on android 6.0 (emulator or device, doesnt matter) this causes exception and app force close.

@gc435
Copy link

gc435 commented Oct 19, 2015

I can confirm that setting the target SDK version to 23 causes my app to crash when playing AACPlayer. It does not crash when the target SDK version is 22. This was tested on the Marshmallow armeabi-v7a emulator.

The issue is that the native components have text relations, and Marshmallow won't load them. Earlier versions of Android would load native components even if they had text relocations.

I believe the solution is to recompile with the latest version of the NDK, and make sure there are no text relocations. More:

I have not rebuilt the aacdecoder components yet myself, since I will target SDK version 22 for the time being.

@wildfatduck
Copy link
Author

Recompile with the latest version of the NDK is not helped

@tarigo
Copy link

tarigo commented Dec 1, 2015

Fixed here.

@radzio
Copy link

radzio commented Dec 11, 2015

@tarigo

Hmm.. when I've used *.so files that I've compiled from your code I'm getting this:

12-11 20:40:10.142 1888-1888/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-11 20:40:10.142 1888-1888/? A/DEBUG: Build fingerprint: 'google/shamu/shamu:6.0/MRA58R/2308909:user/release-keys'
12-11 20:40:10.142 1888-1888/? A/DEBUG: Revision: '0'
12-11 20:40:10.142 1888-1888/? A/DEBUG: ABI: 'arm'
12-11 20:40:10.142 1888-1888/? A/DEBUG: pid: 5741, tid: 5787, name: Thread-64612 >>> com.myapp:audio <<<
12-11 20:40:10.142 1888-1888/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
12-11 20:40:10.157 1888-1888/? A/DEBUG: r0 a7c64940 r1 9c6f74b0 r2 00000000 r3 9c6f74b0
12-11 20:40:10.157 1888-1888/? A/DEBUG: r4 00000000 r5 1328c580 r6 13256f40 r7 a7c64940
12-11 20:40:10.157 1888-1888/? A/DEBUG: r8 708fb340 r9 acbdf400 sl 9c6f77ec fp 9c6f76c4
12-11 20:40:10.157 1888-1888/? A/DEBUG: ip a8283231 sp 9c6f7470 lr a026a0ab pc a8283246 cpsr a0070030
12-11 20:40:10.180 1888-1888/? A/DEBUG: backtrace:
12-11 20:40:10.181 1888-1888/? A/DEBUG: #00 pc 00004246 /data/app/com.myapp-2/lib/arm/libaacdecoder.so (Java_com_spoledge_aacdecoder_Decoder_nativeStart+21)
12-11 20:40:10.181 1888-1888/? A/DEBUG: #1 pc 02b990a9 /data/app/com.myapp-2/oat/arm/base.odex (offset 0x1365000) (int com.spoledge.aacdecoder.Decoder.nativeStart(int, com.spoledge.aacdecoder.BufferReader, com.spoledge.aacdecoder.Decoder$Info)+132)
12-11 20:40:10.181 1888-1888/? A/DEBUG: #2 pc 02b9928b /data/app/com.myapp-2/oat/arm/base.odex (offset 0x1365000) (com.spoledge.aacdecoder.Decoder$Info com.spoledge.aacdecoder.Decoder.start(com.spoledge.aacdecoder.BufferReader)+254)
12-11 20:40:10.181 1888-1888/? A/DEBUG: #3 pc 02b944d9 /data/app/com.myapp-2/oat/arm/base.odex (offset 0x1365000) (void com.spoledge.aacdecoder.AACPlayer.playImpl(java.io.InputStream, int)+428)
12-11 20:40:10.181 1888-1888/? A/DEBUG: #4 pc 02b93c4b /data/app/com.myapp-2/oat/arm/base.odex (offset 0x1365000) (void com.spoledge.aacdecoder.AACPlayer.play(java.io.InputStream, int)+198)
12-11 20:40:10.181 1888-1888/? A/DEBUG: #5 pc 02b93e25 /data/app/com.myapp-2/oat/arm/base.odex (offset 0x1365000) (void com.spoledge.aacdecoder.AACPlayer.play(java.lang.String, int)+312)
12-11 20:40:10.181 1888-1888/? A/DEBUG: #6 pc 02b906b7 /data/app/com.myapp-2/oat/arm/base.odex (offset 0x1365000) (void com.spoledge.aacdecoder.AACPlayer$1.run()+82)
12-11 20:40:10.182 1888-1888/? A/DEBUG: #7 pc 728608d1 /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1eb1000)
12-11 20:40:10.796 1888-1888/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_09

Any ideas?

@tarigo
Copy link

tarigo commented Dec 14, 2015

@radzio
Apparently segfault, memory SEGV_MAPERR - address not mapped to object. Without exact steps to reproduce I can guess only.

@radzio
Copy link

radzio commented Dec 15, 2015

@tarigo it was my fault. I didn't update java code. After it everything has started working like a charm! THX!

@089apps
Copy link

089apps commented Jan 14, 2016

could anyone provide the compiled files
armeabi / libaacdecoder.so
armeabi-v7a / libaacdecoder.so

thx so much

@lucViana
Copy link

@089apps Here it is :)

android.zip

karaoak added a commit to karaoak/ti-android-streamer that referenced this issue Feb 19, 2016
Unfortunately I got the following exception:

INFO] Decoder: start() starting native decoder - OpenCORE-MP3
[INFO] art: art/runtime/thread.cc:1336] No pending exception expected: java.lang.NoSuchMethodError: no non-static method "Lcom/spoledge/aacdecoder/Decoder$Info;.next()Lcom/spoledge/aacdecoder/BufferReader$Buffer;"
[INFO] art: art/runtime/thread.cc:1336] at int com.spoledge.aacdecoder.Decoder.nativeStart(int, com.spoledge.aacdecoder.BufferReader, com.spoledge.aacdecoder.Decoder$Info) (Decoder.java:-2)

Alternatively I found this thread: vbartacek/aacdecoder-android#76
With a link to a android.zip with new compiled accdecoder libs fixing text relocations issues, preventing the lib to run on Android 6.0 Marshmellow.

I updated the libs in the 1.7.1 version of Trevor's module. Everything works now!
@Informatheus
Copy link

@tarigo how do I use your fork?
sorry im noob yet with github but I need to use aacdecoder on android M.
Can somebody please help me?

@Informatheus
Copy link

@karaoak how do i use your fork?

@Informatheus
Copy link

I'm already using the new lib and it works on Android M.
I hosted the files, if someone want:
https://mega.nz/#!EQIVTLIL!mwwakCztR5yd_VjAjS7TJ0kCKO3hrH5mqFkcth9SLc0

@lucViana
Copy link

@Informatheus where did u find it the new lib?

@Informatheus
Copy link

@lucViana are the same that you posted. I only structured according to project folders and zipped with an instructions file.
Very thanks.

@lucViana
Copy link

@Informatheus ooh great :)

@Informatheus
Copy link

@lucViana you have no idea how much u helped me and other developers.
How did you get the files? And from where?

@ravenet
Copy link

ravenet commented Apr 28, 2016

Hi Informatheus,

I see this lib is nice and could we improve further because there are some other issues as well in this lib.

  1. the network packets possible to drop during decoding time so now it is show the log that it is waiting, but there is not event or something to trigger to top level to inform users.
  2. sometimes it is stopped even there is stream available from the server. So if we could retry a few times before give up that would be better.
  3. improve the quality of audio

@citerio
Copy link

citerio commented Jul 20, 2016

Awesome, Informatheus , I am just using the new lib and testing a shoutcast audio/aacp on Eclipse Android 6.0 Emulator and it is working so f...ing awesome, thanks.

@citerio
Copy link

citerio commented Jul 20, 2016

Same thing on Android Studio 2, working great on Android 6.0 emulator.

@bkoruznjak
Copy link

bkoruznjak commented Jan 22, 2017

Just tested it on Nexus 5x with Nougat works like a charm after replacing the .jar and .so files with the ones from the zip provided on the link above. Thank you so very much :)

@a442509097
Copy link

"Informatheus" that's work!

@AppWerft
Copy link

I needed for 64bit (Oreo) for arm64-v8a, armeabi-v7a and x86

@mylselgan
Copy link

mylselgan commented Jul 30, 2019

I needed for 64bit (Oreo) for arm64-v8a, armeabi-v7a and x86

@AppWerft You can download the requsted so files from maximxt@fd8d24b

I have tested its working fine but this maximxt#1 issue occurs rarely.

@AppWerft
Copy link

Currently I'm using a libs package from a phonegap project:
https://github.com/AppWerft/HoerDat/tree/master/modules/android/com.woohoo.androidaudiostreamer/3.0.0/libs

@mylselgan
Copy link

mylselgan commented Jul 30, 2019

@AppWerft have you recreated your app from scratch using Phonegap or can we just use these .so files in our android app for 64 bit support?
what about signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) crash issues?

@AppWerft
Copy link

I found this libs in an phonegap project and I'm using it in my Titanium project. I never seen this crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests