soot-oss / heros

IFDS/IDE Solver for Soot and other frameworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InterruptException in CountLatch

johanneslerch opened this issue · comments

Hi,

from time to time i get InterruptedExceptions on the main thread when executing tests:
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1301)
at heros.solver.CountLatch.awaitZero(CountLatch.java:75)
at heros.solver.CountingThreadPoolExecutor.awaitCompletion(CountingThreadPoolExecutor.java:69)
at heros.alias.FieldSensitiveIFDSSolver.runExecutorAndAwaitCompletion(FieldSensitiveIFDSSolver.java:178)
at heros.alias.FieldSensitiveIFDSSolver.awaitCompletionComputeValuesAndShutdown(FieldSensitiveIFDSSolver.java:159)
at heros.alias.FieldSensitiveIFDSSolver.solve(FieldSensitiveIFDSSolver.java:135)

Changing the call in CountLatch.awaitZero from sync.acquireSharedInterruptibly(1) to sync.acquireShared(1) seems to solve this issue. Yet, i am not absolutely sure this change makes sense, nor if the InterruptedException should not occur in the first place. Therefore, i am not sure if i am working around the symptom instead of really fixing the bug.
I would appreciate if someone could have a second look at this.

The stack trace above contains FieldSensitiveIFDSSolver, which is a modification of FlowDroids FastSolver, but this should occur with the default IDESolver as well.

Changed to sync.acquireShared(1), which seems to solve the issue.