On Mon, Feb 27, 2012 at 5:33 PM, Michael wrote:We are experiencing the same issue and were able to build a minimal
example (based on hello-jni) to reproduce the problem.
Our example project can be downloaded here:
http://bit.ly/yaHBEL and
then installed with, e.g.
android update project -p .
ndk-build -B NDK_DEBUG=1
ant all clean debug install
The relevant content of the project is listed below.
Note that the crash only occurs on TEGRA devices and when the native
code is compiled with NDK r7b (everything works with r7).
The immediate trigger of the SIGILL crash seems to be the use of a
cmath function on a volatile floating point variable. Making the
variables non-volatile or substituting <cmath> by <math.h> will fix
the issue in this particular example.
The below code will produce a crash, but there seem to be other not-so-
clear ways to make it crash, too. In our production code, for example,
we are not using 'volatile', yet it crashes with
Stack frame #00 pc 00002db4 /data/data/com.X/lib/libX.so (sinf):
Unable to locate routine information for address 2db4 in module ./obj/
local/armeabi-v7a/libX.so
As a result, we currently don't have a workaround for the issue,
besides reverting to use of NDK r7.
I hope the provided example will help to identify and fix the problem.
Best,
Michael
-----------------
Android.mk
----------
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := hello-jni
LOCAL_SRC_FILES := hello-jni.cpp
include $(BUILD_SHARED_LIBRARY)
Application.mk
--------------
APP_ABI := armeabi armeabi-v7a
APP_OPTIM := release
APP_STL := gnustl_static
hello-jni.cpp
-------------
#include <string.h>
#include <jni.h>
#include <cmath>
extern "C"
{
jstring
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )
{
volatile float sinresult = std::sin(1.0f);
volatile float cosresult = std::sin(sinresult);
volatile float powresult = std::pow(cosresult, 2);
if (powresult < 0)
return env->NewStringUTF("RESULT 0");
else
return env->NewStringUTF("RESULT 1");
}
}
On Feb 18, 9:14 pm, Olivier Chatry wrote:Still crashing on TEGRA, but working on a HTC desire :(
--
Olivier Chatry
Sent with Sparrow (http://www.sparrowmailapp.com)
On Friday, February 17, 2012 at 8:28 PM, Olivier Chatry wrote:
These are Android.mk and Application.mk. but these project are really
different, using different rendering engine. Everything work very fine with
r7, but crash with r7b.
'm really not doing anything fancy.
On Fri, Feb 17, 2012 at 7:55 PM, David Turner (mailto:
[email protected])> wrote:
The math library doesn't use NEON. What's surprising is that there
seems to be a copy of cosf / powf inside your own shared library.
How do you build this exactly?
On Fri, Feb 17, 2012 at 9:41 AM, Olivier Chatry <
olivi
[email protected] (mailto:
[email protected])> wrote:
(very wild guess : I'm testing on a TEGRA chipset, is there any
way that the libmath ( or whatever ) is using NEON ? It works find if I
switch back to r7.
On Fri, Feb 17, 2012 at 6:39 PM, Olivier Chatry <
olivi
[email protected] (mailto:
[email protected])> wrote:
Tried with another of my lib, baked on linux, clean build got
that :
'lge/lge_star/p990_EUR-xx:2.3.4/GRJ22/lgp990-V20l.422C563E:user/release-keys'
pid: 17138, tid: 17146 >>> com.myVR.mMap.demo <<<
signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 80522de8
Stack frame #00 pc 00122de8
/data/data/com.myVR.mMap.demo/lib/libmMap.so (powf): Unable to locate
routine information for address 122de8 in module
obj/local/armeabi-v7a//libmMap.so
Guess the there is a problem with libmath :(
On Fri, Feb 17, 2012 at 2:47 PM, Olivier Chatry <
olivi
[email protected] (mailto:
[email protected])> wrote:
After a full / clean / rebuild of everything, compile in
thumb-mode armv7a only, my app is now crashing with this message ( taken
from ndk-stack )
********** Crash dump: **********
Build fingerprint:
'lge/lge_star/p990_EUR-xx:2.3.4/GRJ22/lgp990-V20l.422C563E:user/release-keys'
pid: 309, tid: 321 >>> com.massivefinger.PinballMania <<<
signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 81864f14
Stack frame #00 pc 00864f14
/mnt/asec/com.massivefinger.PinballMania-2/lib/libPinballMania.so (cosf):
Unable to locate routine information for address 864f14 in module
obj/local/armeabi-v7a//libPinballMania.so
--
You received this message because you are subscribed to the Google
Groups "android-ndk" group.
[email protected]).
To unsubscribe from this group, send email to
[email protected] (mailto:
android-ndk%
[email protected]).
For more options, visit this group athttp://
groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google
Groups "android-ndk" group.
[email protected]).
To unsubscribe from this group, send email to
[email protected] (mailto:
android-ndk%
[email protected]).
For more options, visit this group athttp://
groups.google.com/group/android-ndk?hl=en.
Attachments:
- Android.mk
- Application.mk
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To post to this group, send email to
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en. You received this message because you are subscribed to the Google Groups "android-ndk" group.
.
.