Occasionally app freeze an Chevron.setLocation()

Hello!

I adopted the Map Driving Extension example from the documentation where I calculate the route and let the user drive along this route. I let a chevron follow and indicate the user’s current location. Like in the example I registered a MatcherListener and in the onMatched() method I set the new chevron’s location using Chevron.setLocation() method. Making tests I realized that the my app occasionally freezes. I investigated that the app is hanging calling the Chevron.setLocation() method (on the main thread), more precize in the NativeGpsIndicatorWrapper.nativeSetLocation() call. See the screenshot of the corresponding stacktrace:

I dont’t see any workaround for this so it seems to be a critical blocker making this feature unusable.

Any help is appreciated!

Best regards,
Leo

Hello!

It will take some time to investigate this issue. To speed things up, can you please share the SDK version which you are using and also the relevant source code?
Have you tried to reproduce this problem by using our Maps SDK Examples application?

1 Like

Hello Mateusz,

I could reproduce my app freeze issue using the unchanged (except for entering my API key) Maps SDK Example application I cloned today from GitHub. After staring the app I went to “Chevron tracking”, started and stopped and started tracking a couple of times. Than I left the device on my table, went to a colleague and after I came back I switched the display on and realized that the app is frozen. The connected Android Studio Debugger revealed that the main thread is stuck in NativeGpsIndicatorWrapper.nativeSetLocation() call:

grafik

The device I use: Samsung Galaxy Tab Active2 (aka SM-T395) running Android 9.

Here is the screeshot of the app at the point it froze:

Here is the full thread dump:

“pool-3-thread-1@13362” prio=5 tid=0x4a3 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at libcore.io.Linux.readBytes(Linux.java:-1)
at libcore.io.Linux.read(Linux.java:184)
at libcore.io.BlockGuardOs.read(BlockGuardOs.java:254)
at libcore.io.IoBridge.read(IoBridge.java:501)
at java.io.FileInputStream.read(FileInputStream.java:307)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:347)
- locked <0x3785> (a java.lang.UNIXProcess$ProcessPipeInputStream)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:351)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180)
- locked <0x3786> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:172)
at java.io.BufferedReader.readLine(BufferedReader.java:335)
at java.io.BufferedReader.readLine(BufferedReader.java:400)
at com.tomtom.online.sdk.common.util.a.a(Unknown Source:-1)
at com.tomtom.online.sdk.common.util.a.run(Unknown Source:-1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

“RxSchedulerPurge-1@12712” daemon prio=5 tid=0x49c nid=NA waiting
java.lang.Thread.State: WAITING
blocks RxSchedulerPurge-1@12712
at java.lang.Object.wait(Object.java:-1)
at java.lang.Thread.parkFor$(Thread.java:2137)
- locked <0x3780> (a java.lang.Object)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2101)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1132)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:849)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

“RxCachedWorkerPoolEvictor-1@12727” daemon prio=5 tid=0x49d nid=NA waiting
java.lang.Thread.State: WAITING
blocks RxCachedWorkerPoolEvictor-1@12727
at java.lang.Object.wait(Object.java:-1)
at java.lang.Thread.parkFor$(Thread.java:2137)
- locked <0x3781> (a java.lang.Object)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2101)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1132)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:849)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

“GAC_Executor[0]@13358” prio=5 tid=0x4a2 nid=NA waiting
java.lang.Thread.State: WAITING
blocks GAC_Executor[0]@13358
at java.lang.Object.wait(Object.java:-1)
at java.lang.Thread.parkFor$(Thread.java:2137)
- locked <0x3784> (a java.lang.Object)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:-1)
at java.lang.Thread.run(Thread.java:764)

“GAC_Executor[1]@13392” prio=5 tid=0x4a6 nid=NA waiting
java.lang.Thread.State: WAITING
blocks GAC_Executor[1]@13392
at java.lang.Object.wait(Object.java:-1)
at java.lang.Thread.parkFor$(Thread.java:2137)
- locked <0x3787> (a java.lang.Object)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:-1)
at java.lang.Thread.run(Thread.java:764)

“main@11184” prio=5 tid=0x2 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at com.tomtom.core.maps.NativeGpsIndicatorWrapper.nativeSetLocation(NativeGpsIndicatorWrapper.java:-1)
at com.tomtom.core.maps.NativeGpsIndicatorWrapper.setLocation(NativeGpsIndicatorWrapper.java:107)
at com.tomtom.online.sdk.map.d.setLocation(Unknown Source:-1)
at com.tomtom.online.sdk.samples.cases.driving.ChevronSimulatorUpdater.onNewRoutePointVisited(ChevronSimulatorUpdater.java:28)
at com.tomtom.online.sdk.samples.cases.driving.utils.BaseSimulator.run(BaseSimulator.java:86)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7179)
at java.lang.reflect.Method.invoke(Method.java:-1)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

“arch_disk_io_0@12838” prio=5 tid=0x4a0 nid=NA waiting
java.lang.Thread.State: WAITING
blocks arch_disk_io_0@12838
at java.lang.Object.wait(Object.java:-1)
at java.lang.Thread.parkFor$(Thread.java:2137)
- locked <0x3782> (a java.lang.Object)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

“arch_disk_io_1@12995” prio=5 tid=0x4a1 nid=NA waiting
java.lang.Thread.State: WAITING
blocks arch_disk_io_1@12995
at java.lang.Object.wait(Object.java:-1)
at java.lang.Thread.parkFor$(Thread.java:2137)
- locked <0x3783> (a java.lang.Object)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

“FinalizerDaemon@14188” daemon prio=5 tid=0x48c nid=NA waiting
java.lang.Thread.State: WAITING
blocks FinalizerDaemon@14188
at java.lang.Object.wait(Object.java:-1)
at java.lang.Object.wait(Object.java:422)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:188)
- locked <0x377d> (a java.lang.Object)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:209)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:232)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)

“FinalizerWatchdogDaemon@14189” daemon prio=5 tid=0x48d nid=NA waiting
java.lang.Thread.State: WAITING
blocks FinalizerWatchdogDaemon@14189
at java.lang.Object.wait(Object.java:-1)
at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded(Daemons.java:297)
- locked <0x377e> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:277)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)

“ReferenceQueueDaemon@14186” daemon prio=5 tid=0x48b nid=NA waiting
java.lang.Thread.State: WAITING
blocks ReferenceQueueDaemon@14186
at java.lang.Object.wait(Object.java:-1)
at java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:178)
- locked <0x2539> (a java.lang.Class)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)

“process reaper@13363” daemon prio=10 tid=0x4a4 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at java.lang.UNIXProcess.waitForProcessExit(UNIXProcess.java:-1)
at java.lang.UNIXProcess.access$200(UNIXProcess.java:55)
at java.lang.UNIXProcess$3.run(UNIXProcess.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

“HeapTaskDaemon@14187” daemon prio=5 tid=0x48e nid=NA waiting
java.lang.Thread.State: WAITING
at dalvik.system.VMRuntime.runHeapTasks(VMRuntime.java:-1)
at java.lang.Daemons$HeapTaskDaemon.runInternal(Daemons.java:475)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)

“LeakCanary-Heap-Dump@11346” prio=5 tid=0x497 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at android.os.MessageQueue.nativePollOnce(MessageQueue.java:-1)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:181)
at android.os.HandlerThread.run(HandlerThread.java:65)

“queued-work-looper@11392” prio=5 tid=0x499 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at android.os.MessageQueue.nativePollOnce(MessageQueue.java:-1)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:181)
at android.os.HandlerThread.run(HandlerThread.java:65)

“GoogleApiHandler@13454” prio=5 tid=0x4a7 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at android.os.MessageQueue.nativePollOnce(MessageQueue.java:-1)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:181)
at android.os.HandlerThread.run(HandlerThread.java:65)

“Timer-0@12022” prio=5 tid=0x49b nid=NA waiting
java.lang.Thread.State: WAITING
blocks Timer-0@12022
at java.lang.Object.wait(Object.java:-1)
at java.util.TimerThread.mainLoop(Timer.java:533)
- locked <0x377f> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:512)

“Jit thread pool worker thread 0@12996” daemon prio=5 tid=0x488 nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Signal Catcher@14184” daemon prio=5 tid=0x489 nid=NA waiting
java.lang.Thread.State: WAITING

“ADB-JDWP Connection Control Thread@14185” daemon prio=0 tid=0x48a nid=NA waiting
java.lang.Thread.State: WAITING

“Binder:14047_1@13506” prio=5 tid=0x48f nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_2@14190” prio=5 tid=0x490 nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_3@14191” prio=5 tid=0x491 nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_4@14192” prio=5 tid=0x492 nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Profile Saver@11187” daemon prio=5 tid=0x496 nid=NA runnable
java.lang.Thread.State: RUNNABLE

“RenderThread@12747” daemon prio=7 tid=0x49f nid=NA runnable
java.lang.Thread.State: RUNNABLE

“hwuiTask1@13387” prio=5 tid=0x4a5 nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_5@14200” prio=5 tid=0x4ab nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_6@14201” prio=5 tid=0x4ac nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_7@14202” prio=5 tid=0x4ad nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_8@14203” prio=5 tid=0x4ae nid=NA runnable
java.lang.Thread.State: RUNNABLE

“Binder:14047_9@14204” prio=5 tid=0x4af nid=NA runnable
java.lang.Thread.State: RUNNABLE


1 Like

Thanks a lot for your effort. I’ve managed to reproduce this issue with your steps. The issue indeed occurs randomly and sometimes after pressing ‘Wait’ on the ANR dialog, the issue is not occurring anymore.
We’ll investigate it further. I’ll keep you posted with any updates.

1 Like

Hello Mateusz,

what do you mean saying “the issue is not occuring anymore”? Do you have new insights or workarounds concerning this issue?

Best regards,
Leo

1 Like

Hello,

I don’t have any new updates yet. Saying “issue is not occurring anymore”, I meant, that if I click ‘wait’ on the ANR dialog and leave the app frozen, after couple seconds it starts working again as expected without any crash. When I’ll have any updates from the SDK team regarding that issue, I’ll inform you immediately.

Regards,
Mateusz