aacdecoder-android
aacdecoder-android copied to clipboard
Text relocations and crash in android 6.0
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.
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:
- http://slowbutdeadly.blogspot.mk/2015/09/javalangunsatisfiedlinkerror-dlopen.html
- http://stackoverflow.com/questions/32346402/libavcodec-so-has-text-relocations
I have not rebuilt the aacdecoder components yet myself, since I will target SDK version 22 for the time being.
Recompile with the latest version of the NDK is not helped
Fixed here.
@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: #01 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: #02 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: #03 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: #04 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: #05 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: #06 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: #07 pc 728608d1 /data/dalvik-cache/arm/system@[email protected] (offset 0x1eb1000) 12-11 20:40:10.796 1888-1888/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_09
Any ideas?
@radzio Apparently segfault, memory SEGV_MAPERR - address not mapped to object. Without exact steps to reproduce I can guess only.
@tarigo it was my fault. I didn't update java code. After it everything has started working like a charm! THX!
could anyone provide the compiled files armeabi / libaacdecoder.so armeabi-v7a / libaacdecoder.so
thx so much
@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?
@karaoak how do i use your fork?
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
@Informatheus where did u find it the new lib?
@lucViana are the same that you posted. I only structured according to project folders and zipped with an instructions file. Very thanks.
@Informatheus ooh great :)
@lucViana you have no idea how much u helped me and other developers. How did you get the files? And from where?
Hi Informatheus,
I see this lib is nice and could we improve further because there are some other issues as well in this lib.
- 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.
- 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.
- improve the quality of audio
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.
Same thing on Android Studio 2, working great on Android 6.0 emulator.
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 :)
"Informatheus" that's work!
I needed for 64bit (Oreo) for arm64-v8a, armeabi-v7a and x86
I needed for 64bit (Oreo) for arm64-v8a, armeabi-v7a and x86
@AppWerft You can download the requsted so files from https://github.com/maximxt/aacdecoder-android/commit/fd8d24bd56fe10658e88d81b617d41536e480960
I have tested its working fine but this https://github.com/maximxt/aacdecoder-android/issues/1 issue occurs rarely.
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
@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?
I found this libs in an phonegap project and I'm using it in my Titanium project. I never seen this crash.