DoubangoTelecom / imsdroid

High Quality Video SIP/IMS client for Google Android
https://doubango.org
Other
294 stars 168 forks source link

crashed on startup on Asus K010 Intel CPU #599

Open zaferaydn opened 7 years ago

zaferaydn commented 7 years ago

Hello; I downloaded the lastest repository as a zip file. I opened the project Imsdroid with Android Studio. I successfully build and install the apk on my tablet. But application fails on start up. Android reports a messagebox saying "IMSDroid has stopped".

My tablet is Asus K010 which has intel atom cpu(I guess). Doesn't Imsdroid run on intel CPU? Is there any known issue?

I attach the logcat output where I think the error happens:

03-12 20:29:24.940 10115-10115/? D/org.doubango.ngn.NgnApplication: Build.MODEL=k010 03-12 20:29:24.940 10115-10115/? D/org.doubango.ngn.NgnApplication: Build.VERSION.SDK=19 03-12 20:29:24.940 10115-10115/? D/dalvikvm: Trying to load lib /data/app-lib/org.doubango.imsdroid-1/libutils_armv5te.so 0x43c68e10 03-12 20:29:24.950 10115-10115/? D/houdini: [10115] Loading library(version: 4.0.8.45720 RELEASE)... successfully. 03-12 20:29:24.950 10115-10115/? D/dalvikvm: Added shared lib /data/app-lib/org.doubango.imsdroid-1/libutils_armv5te.so 0x43c68e10 03-12 20:29:24.950 10115-10115/? D/dalvikvm: No JNI_OnLoad found in /data/app-lib/org.doubango.imsdroid-1/libutils_armv5te.so 0x43c68e10, skipping init 03-12 20:29:24.950 10115-10115/? D/org.doubango.ngn.NgnEngine: CPU_Feature=15 03-12 20:29:24.950 10115-10115/? D/org.doubango.ngn.NgnEngine: isCpuNeon()=YES 03-12 20:29:24.950 10115-10115/? D/dalvikvm: Trying to load lib /data/app-lib/org.doubango.imsdroid-1/libtinyWRAP_neon.so 0x43c68e10 03-12 20:29:24.960 10115-10115/? D/houdini: [10115] Unsupported feature (ID:0x20e00149). 03-12 20:29:24.960 10115-10115/? A/libc: Fatal signal 11 (SIGSEGV) at 0xdead0000 (code=1), thread 10115 (ubango.imsdroid)

edit: When i disable neon library, it works! In NgnEngine.initialize2 function I commented NgnApplication.isCpuNeon() block. So it wont load neon library. At this case it work properly. But disabling neon library usage can have some sideffects? Any real solution?

zaferaydn commented 7 years ago

I realised that android os loads armv7 libraries insead of x86. I guess there is a feature in android os called houdini that similuates armv7 libraries as x86. But somehow houdini fails while trying to simulate neon library of libtinyWRAP_neon library.

I researched alittle bit, and i found why android os tries to simulate armv7 libraries with houdini insead of using x86 libraries directly. Because there are missing library files in x86 folder(libtinyWRAP_neon and libutils_armv5te are only in armeabi-v7a folder), android thinks that there is missing libraries in x86 so it tries to loads armv7 libraries insead.

I made a workaround by adding fake libraries named libtinyWRAP_neon and libutils_armv5 (with 15 bytes fakes content for example) into the x86 and armeabi folder where these libraries missed. So in the end, all folders(armeabi, armeabi-v7a and x86) have same number of libraries. Then android decided to load x86 libraries.

I also needed to add following line in initialize2function:

File refFile = new File(String.format("%s/%s", NgnEngine.LIBS_FOLDER, "libutils_armv5te.so")); boolean haveLibUtils = refFile.exists() && refFile.length() > 0;