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

crash when using SpassFingerprint.RegisteredFingerprintName #1

Open
seligam opened this issue Jun 26, 2015 · 1 comment
Open

crash when using SpassFingerprint.RegisteredFingerprintName #1

seligam opened this issue Jun 26, 2015 · 1 comment

Comments

@seligam
Copy link

seligam commented Jun 26, 2015

hi

I am using Xamarin studio 5.9.3, Xamarin Android support 22.2.0.0 (if it is important)

when I call SpassFingerprint.RegisteredFingerprintName on Samsung Galaxy S6 application crashes immediately with this error log

I/FPMS_SamsungFingerprintProxyFactory( 6043): getFingerprintIndexList FP_PROXY FINISH (1ms) RESULT: [I@2f0fbcaa
I/PersonaManagerService( 3691): getParentId() for 0
F/art     (26346): sart/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: not an array: android.util.SparseArray
F/art     (26346): sart/runtime/check_jni.cc:65]     in call to GetArrayLength
F/art     (26346): sart/runtime/check_jni.cc:65]     from java.lang.Object md5bc232938925bcb871197f46a495ecf2e.FingerPrintEvaluate.n_doInBackground(java.lang.Object[])
F/art     (26346): sart/runtime/check_jni.cc:65] "AsyncTask #4" prio=5 tid=20 Runnable
F/art     (26346): sart/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x12dcb520 self=0xf4b7d800
F/art     (26346): sart/runtime/check_jni.cc:65]   | sysTid=27068 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0xdc846480
F/art     (26346): sart/runtime/check_jni.cc:65]   | state=R schedstat=( 0 0 0 ) utm=1 stm=0 core=3 HZ=100
F/art     (26346): sart/runtime/check_jni.cc:65]   | stack=0xda9d4000-0xda9d6000 stackSize=1036KB
F/art     (26346): sart/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #00 pc 00004e64  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #01 pc 00003665  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #02 pc 0025f37d  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #03 pc 00241a2f  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+158)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #04 pc 000b3933  /system/lib/libart.so (art::JniAbort(char const*, char const*)+610)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #05 pc 000b4059  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #06 pc 001d1159  /system/lib/libart.so (art::JNI::GetArrayLength(_JNIEnv*, _jarray*)+660)
F/art     (26346): sart/runtime/check_jni.cc:65]   native: #07 pc 00004624   (???)
F/art     (26346): sart/runtime/check_jni.cc:65]   at md5bc232938925bcb871197f46a495ecf2e.FingerPrintEvaluate.n_doInBackground(Native method)
F/art     (26346): sart/runtime/check_jni.cc:65]   at md5bc232938925bcb871197f46a495ecf2e.FingerPrintEvaluate.doInBackground(FingerPrintEvaluate.java:33)
F/art     (26346): sart/runtime/check_jni.cc:65]   at android.os.AsyncTask$2.call(AsyncTask.java:292)
F/art     (26346): sart/runtime/check_jni.cc:65]   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
F/art     (26346): sart/runtime/check_jni.cc:65]   at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
F/art     (26346): sart/runtime/check_jni.cc:65]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
F/art     (26346): sart/runtime/check_jni.cc:65]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
F/art     (26346): sart/runtime/check_jni.cc:65]   at java.lang.Thread.run(Thread.java:818)

it happens on

sparseArray.ToArray<string>()

there is no crash when i replaced

return new List<string> (sparseArray.ToArray<string> ());

with

List<string> l=new List<string> ();
for(int i = 0; i < sparseArray.Size(); i++) {
    int key = sparseArray.KeyAt(i);
    string s = (string)sparseArray.Get(key);
    l.Add (s);
}
return l;

same this is also in RegisteredFingerprintUniqueId

btw I don't know where this SparseArray.ToArray came from, there is no such method in android documentation. Maybe it is something added by Xamarin and it is their implementation which is buggy.

@seligam
Copy link
Author

seligam commented Jun 26, 2015

at the end i changed these 2 functions to return SparseArray which is then processed in application.
conversion to IList moved indexes so index returned by IdentifiedFingerprintIndex was pointing to wrong name/uid. Probably it would be enough just to subtract 1 from returned index, but i think working with native structure is safer

so in final version

return new List<string> (sparseArray.ToArray<string> ());

is replaced with

return sparseArray;

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

1 participant