Closed durban closed 5 months ago
It sounds like https://github.com/JetBrains/lincheck/issues/194? I pin to the older version because of this.
Hi @durban! Thank you for the bug report and the detailed investigation.
I was trying to reproduce the bug on the develop branch of the Lincheck, but it looks like the bug is already fixed on this branch. I did some bisecting and found out that the following commit fixes the bug (this line to be precise).
We will prepare a new release encompassing the latest changes from the develop branch, including the commit that fixes the bug you reported.
CC @ndkoval
Sounds good, thank you!
Hi @durban ! Could you please re-check if the 2.24 release fixes the issue for you?
Yes, 2.24 seems to work fine. Thanks!
I think I found a bug, which I can't minimize, but can always reproduce. To reproduce it, these steps are necessary (git and sbt are needed):
Unfortunately there are a lot of things in that repo, and I haven't succeeded in reproducing the issue with a small test. The test in question is here: https://github.com/durban/choam/blob/998d514d88d4296db8f616a8ff68844c9874ca16/stress/stress-linchk/src/test/scala/dev/tauri/choam/data/TtrieModelTest.scala.
With this test, I get the following output:
With some debugging, I could confirm, that the test times out here: https://github.com/JetBrains/lincheck/blob/lincheck-2.23/src/jvm/main/org/jetbrains/kotlinx/lincheck/runner/ParallelThreadsRunner.kt#L288. However, increasing the timeout doesn't solve the issue. The 2 threads in question just seem to wait indefinitely: one of them (
Thread-0
above) is blocked inLockSupport.park
, the other (Thread-1
above) is spinning inManagedStrategy.awaitTurn
(ManagedStrategy.kt:406). The latter one is not visible above, but I've attached a full thread dump (threaddump.txt), here is the relevant part:This might be a red herring, but looking at a heap dump, I see an
org.jetbrains.kotlinx.lincheck.runner.FixedActiveThreadsExecutor
with itsresults
array having anIllegalStateException
(with messageTrying to switch the execution to thread 0,but only the following threads are eligible to switch: [1]
) at index0
. Maybe this exception is thrown (probably here), and somehow this makes the two threads lock up? Although I'm not that familiar with the code...