You may have better luck with the [android-ndk] Google Group.

On Wed, Aug 10, 2011 at 4:03 PM, halli manjunatha <[email protected]> wrote:
> HI All,
>
> I am trying to call the JAVA methods from C++ layer and following is  my
> problem,
>
> Crash message:
>
> E/dalvikvm( 2687): JNI ERROR (app bug): accessed stale local reference
> 0x38000025 (index 9 in a table of size 0)
> E/dalvikvm( 2687): VM aborting
>
> Observation:
>
> Actually JNI layer is trying to report the status of  power ON  sequence to
>  service layer, so it gets the java callback function using JNIEnv and
> reports the status. Below figure depicts what I am  doing in JNI
>
> Main Thread -- - vm->GetEnv() --- env->GetObjectClass() ---
> env->GetMethodID() --- Start Sub-Thread
>
> Sub Thread --- vm->AttchCurrentThread() --- env->GetObjectClass()  {Dalvik
> Crashes here}
>
>
> Call to env->GetObjectClass() succeeds without any problem for the first
> time (when it is called from main thread, this time I gets the JNIenv by
> calling vm->GetEnv()) but the subsequent call(from a sub thread which is
> invoked from main thread, this time I get the JNIenv by calling
> vm->AttachCurrentThread()) fails with the above crash  message.
>
> When GetObjectClass() called second time, DalvicVM is crashing in function
> "dvmDecodeIndirectRef()" in file dalvic/vm/Jni.c
>
> Questions:
> 1) since it is passing for the first time i doubt its some thing related to
> memory accessing issue, please point me out where i am  doing wrong
>
> --
> Regards
> Halli
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" 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-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en

Reply via email to