Wednesday, 1 August 2018

Debugging Java InterruptedException i.e. finding the cause

During debugging of Android app, sometimes InterruptedException occurs and crashes the app. I've been able to set a breakpoint on default exception handler, but call stack is not informative.

    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1991)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2025)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1048)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:776)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:820)

What is telling is that the interrupted thread is always RxCachedThreadScheduler-4 (or some other number)

What would be a systematic approach towards finding the root cause of the exception?



from Debugging Java InterruptedException i.e. finding the cause

No comments:

Post a Comment