Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25679

Android: Crash when setting wrong accuracy in Ti.Geolocation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 7.0.0
    • Fix Version/s: Release 7.1.0
    • Component/s: Android
    • Labels:
    • Story Points:
      1
    • Sprint:
      2018 Sprint 01 SDK, 2018 Sprint 02 SDK, 2018 Sprint 03 SDK

      Description

      Problem:
      I was using a not supported accuracy for Ti.Geolocation on Android:
      Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST_FOR_NAVIGATION;
      which is only supported on iOS and ended up with this crash:

      [INFO]  art: art/runtime/java_vm_ext.cc:508] JNI DETECTED ERROR IN APPLICATION: obj == null
      [INFO]  art: art/runtime/java_vm_ext.cc:508]     in call to CallObjectMethodV
      [INFO]  art: art/runtime/java_vm_ext.cc:508]     from boolean org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(long, java.lang.Object, long, java.lang.String, java.lang.Object, boolean, boolean, int, java.lang.String)
      [INFO]  art: art/runtime/java_vm_ext.cc:508] "main" prio=5 tid=1 Runnable
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   | group="main" sCount=0 dsCount=0 obj=0x7498f380 self=0x7f94354a00
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   | sysTid=26990 nice=0 cgrp=default sched=0/0 handle=0x7f946a4a98
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   | state=R schedstat=( 0 0 0 ) utm=406 stm=22 core=3 HZ=100
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   | stack=0x7fd3369000-0x7fd336b000 stackSize=8MB
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   | held mutexes= "mutator lock"(shared held)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #00 pc 000000000047c5a8  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #01 pc 000000000047c5a4  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+216)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #02 pc 000000000045042c  /system/lib64/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+484)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #03 pc 00000000002efff0  /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1128)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #04 pc 00000000002f07c8  /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+184)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #05 pc 000000000032ec6c  /system/lib64/libart.so (_ZN3art3JNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+768)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #06 pc 000000000045665c  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+124)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #07 pc 00000000004614c4  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN8titanium13TypeConverter19jsValueToJavaObjectEPN2v87IsolateEP7_JNIEnvNS1_5LocalINS1_5ValueEEEPb+1068)                                                                                                                                                                                                                                        
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #08 pc 0000000000469688  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN8titanium10KrollProxy18_fireEventToParentERKN2v820FunctionCallbackInfoINS1_5ValueEEE+304)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #09 pc 0000000000728c00  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+188)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #10 pc 000000000077cb6c  /data/app/com.app/lib/arm64/libkroll-v8.so (???)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #11 pc 000000000077d150  /data/app/com.app/lib/arm64/libkroll-v8.so (???)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #12 pc 000000000077d3bc  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN2v88internal21Builtin_HandleApiCallEiPPNS0_6ObjectEPNS0_7IsolateE+28)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   native: #13 pc 00000000000000e4   (???)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native method)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:934)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1157)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:116)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:468)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at android.os.Handler.dispatchMessage(Handler.java:98)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at android.os.Looper.loop(Looper.java:173)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at android.app.ActivityThread.main(ActivityThread.java:6459)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at java.lang.reflect.Method.invoke!(Native method)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
      [INFO]  art: art/runtime/java_vm_ext.cc:508]
      [INFO]  art: art/runtime/runtime.cc:403] Runtime aborting...
      [INFO]  art: art/runtime/runtime.cc:403] Aborting thread:
      [INFO]  art: art/runtime/runtime.cc:403] "main" prio=5 tid=1 Native
      [INFO]  art: art/runtime/runtime.cc:403]   | group="" sCount=0 dsCount=0 obj=0x7498f380 self=0x7f94354a00
      [INFO]  art: art/runtime/runtime.cc:403]   | sysTid=26990 nice=0 cgrp=default sched=0/0 handle=0x7f946a4a98
      [INFO]  art: art/runtime/runtime.cc:403]   | state=R schedstat=( 0 0 0 ) utm=407 stm=23 core=3 HZ=100
      [INFO]  art: art/runtime/runtime.cc:403]   | stack=0x7fd3369000-0x7fd336b000 stackSize=8MB
      [INFO]  art: art/runtime/runtime.cc:403]   | held mutexes= "abort lock"
      [INFO]  art: art/runtime/runtime.cc:403]   native: #00 pc 000000000047c5a8  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #01 pc 000000000047c5a4  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+216)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #02 pc 000000000045042c  /system/lib64/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+484)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #03 pc 000000000043bac8  /system/lib64/libart.so (_ZNK3art10AbortState10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+56)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #04 pc 000000000043e540  /system/lib64/libart.so (_ZNK3art10AbortState4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+668)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #05 pc 0000000000431b9c  /system/lib64/libart.so (_ZN3art7Runtime5AbortEv+140)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #06 pc 00000000000e5324  /system/lib64/libart.so (_ZN3art10LogMessageD2Ev+1204)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #07 pc 00000000002f0404  /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+2172)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #08 pc 00000000002f07c8  /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+184)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #09 pc 000000000032ec6c  /system/lib64/libart.so (_ZN3art3JNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+768)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #10 pc 000000000045665c  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+124)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #11 pc 00000000004614c4  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN8titanium13TypeConverter19jsValueToJavaObjectEPN2v87IsolateEP7_JNIEnvNS1_5LocalINS1_5ValueEEEPb+1068)                                                                                                                                                                                                                                            
      [INFO]  art: art/runtime/runtime.cc:403]   native: #12 pc 0000000000469688  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN8titanium10KrollProxy18_fireEventToParentERKN2v820FunctionCallbackInfoINS1_5ValueEEE+304)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #13 pc 0000000000728c00  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+188)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #14 pc 000000000077cb6c  /data/app/com.app/lib/arm64/libkroll-v8.so (???)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #15 pc 000000000077d150  /data/app/com.app/lib/arm64/libkroll-v8.so (???)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #16 pc 000000000077d3bc  /data/app/com.app/lib/arm64/libkroll-v8.so (_ZN2v88internal21Builtin_HandleApiCallEiPPNS0_6ObjectEPNS0_7IsolateE+28)
      [INFO]  art: art/runtime/runtime.cc:403]   native: #17 pc 00000000000000e4   (???)
      [INFO]  art: art/runtime/runtime.cc:403]   at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native method)
      [INFO]  art: art/runtime/runtime.cc:403]   at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
      [INFO]  art: art/runtime/runtime.cc:403]   at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:934)
      [INFO]  art: art/runtime/runtime.cc:403]   at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1157)
      [INFO]  art: art/runtime/runtime.cc:403]   at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
      [INFO]  art: art/runtime/runtime.cc:403]   at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:116)
      [INFO]  art: art/runtime/runtime.cc:403]   at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:468)
      [INFO]  art: art/runtime/runtime.cc:403]   at android.os.Handler.dispatchMessage(Handler.java:98)
      [INFO]  art: art/runtime/runtime.cc:403]   at android.os.Looper.loop(Looper.java:173)
      [INFO]  art: art/runtime/runtime.cc:403]   at android.app.ActivityThread.main(ActivityThread.java:6459)
      [INFO]  art: art/runtime/runtime.cc:403]   at java.lang.reflect.Method.invoke!(Native method)
      [INFO]  art: art/runtime/runtime.cc:403]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
      [INFO]  art: art/runtime/runtime.cc:403]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
      [INFO]  art: art/runtime/runtime.cc:403] Pending exception java.lang.NumberFormatException: Unable to convert null
      [INFO]  art: art/runtime/runtime.cc:403]   at int org.appcelerator.titanium.util.TiConvert.toInt(java.lang.Object) (TiConvert.java:415)
      [INFO]  art: art/runtime/runtime.cc:403]   at void ti.modules.titanium.geolocation.GeolocationModule.propertyChangedAccuracy(java.lang.Object) (GeolocationModule.java:370)
      [INFO]  art: art/runtime/runtime.cc:403]   at void ti.modules.titanium.geolocation.GeolocationModule.propertyChanged(java.lang.String, java.lang.Object, java.lang.Object, org.appcelerator.kroll.KrollProxy) (GeolocationModule.java:341)
      [INFO]  art: art/runtime/runtime.cc:403]   at void org.appcelerator.kroll.KrollProxy.firePropertyChanged(java.lang.String, java.lang.Object, java.lang.Object) (KrollProxy.java:941)
      [INFO]  art: art/runtime/runtime.cc:403]   at void org.appcelerator.kroll.KrollProxy.onPropertyChanged(java.lang.String, java.lang.Object) (KrollProxy.java:1029)
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(long, java.lang.Object, long, java.lang.String, java.lang.Object, boolean, boolean, int, java.lang.String) (V8Object.java:-2)                                                                                                                                                                                                                                            
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(org.appcelerator.kroll.KrollObject, java.lang.String, java.lang.Object, boolean, boolean, int, java.lang.String) (V8Object.java:62)                                                                                                                                                                                                                                            
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean org.appcelerator.kroll.KrollProxy.doFireEvent(java.lang.String, java.lang.Object) (KrollProxy.java:934)
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean org.appcelerator.kroll.KrollProxy.handleMessage(android.os.Message) (KrollProxy.java:1157)
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(android.os.Message) (TiViewProxy.java:363)
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(android.os.Message) (TiWindowProxy.java:116)
      [INFO]  art: art/runtime/runtime.cc:403]   at boolean ti.modules.titanium.ui.WindowProxy.handleMessage(android.os.Message) (WindowProxy.java:468)
      [INFO]  art: art/runtime/runtime.cc:403]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:98)
      [INFO]  art: art/runtime/runtime.cc:403]   at void android.os.Looper.loop() (Looper.java:173)
      [INFO]  art: art/runtime/runtime.cc:403]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6459)
      [INFO]  art: art/runtime/runtime.cc:403]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
      [INFO]  art: art/runtime/runtime.cc:403]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:938)
      [INFO]  art: art/runtime/runtime.cc:403]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:828)
      

      Solution:
      It shouldn't produce a hard crash with this error message but use a fallback (LOW) and display an error message. Perhaps there are other parts that would produces this crash too if org.appcelerator.titanium.util.TiConvert.toInt(java.lang.Object) (TiConvert.java:415) is the culprit.

      Solution/Workaround:
      Switching to Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_LOW; works fine again.

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              michael Michael G
              Tester:
              Lokesh Choudhary
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code