Skip to content

Commit 6755979

Browse files
committed
Reintroduce run()
1 parent 3177b52 commit 6755979

File tree

51 files changed

+24488
-24154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+24488
-24154
lines changed

src/jvm/main/org/jetbrains/kotlinx/lincheck/strategy/managed/TraceReporter.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ internal fun constructTraceGraph(
245245
prefixProvider = prefixFactory.actorNodePrefix(iCustomThread),
246246
iThread = iThread,
247247
last = lastNode,
248-
callDepth = -1,
249248
actorRepresentation = "run()",
250249
resultRepresentation = null,
251250
isCustomThreadActor = true,
@@ -750,11 +749,9 @@ internal class ActorNode(
750749
traceRepresentation: MutableList<TraceEventRepresentation>,
751750
verboseTrace: Boolean
752751
): TraceNode? {
753-
if (!isCustomThreadActor) {
754-
val actorRepresentation =
755-
prefix + actorRepresentation + if (resultRepresentation != null) ": $resultRepresentation" else ""
756-
traceRepresentation.add(TraceEventRepresentation(iThread, actorRepresentation))
757-
}
752+
val actorRepresentation =
753+
prefix + actorRepresentation + if (resultRepresentation != null) ": $resultRepresentation" else ""
754+
traceRepresentation.add(TraceEventRepresentation(iThread, actorRepresentation))
758755

759756
if (!shouldBeExpanded(verboseTrace)) {
760757
if (isCustomThreadActor) directChildren.forEach { it.addRepresentationTo(traceRepresentation, true) }

src/jvm/test/resources/expected_logs/method_handles/find_special_jdk15.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
java.lang.IllegalStateException: Check failed.
44
at org.jetbrains.kotlinx.lincheck_test.representation.BaseMethodHandleLookupRepresentationTest.block(MethodHandlesLookupTests.kt:58)
55
at org.jetbrains.kotlinx.lincheck_test.representation.BaseMethodHandleLookupRepresentationTest.block(MethodHandlesLookupTests.kt:46)
6-
at org.jetbrains.kotlinx.lincheck_test.representation.BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40)
6+
at org.jetbrains.kotlinx.lincheck_test.representation.BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:42)
77
at java.base/java.lang.Thread.run(Thread.java:832)
88

99
The following interleaving leads to the error:
1010
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1111
| Thread 1 |
1212
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13-
| MethodHandlesFindSpecialRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) |
13+
| MethodHandlesFindSpecialRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:42) |
1414
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1515

1616
Detailed trace:
1717
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1818
| Thread 1 |
1919
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
20-
| MethodHandlesFindSpecialRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) |
20+
| MethodHandlesFindSpecialRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:42) |
2121
| block(): threw IllegalStateException at BaseMethodHandleLookupRepresentationTest.block(MethodHandlesLookupTests.kt:46) |
2222
| doTest() at BaseMethodHandleLookupRepresentationTest.block(MethodHandlesLookupTests.kt:55) |
2323
| Companion#1.create(): CounterDerived#1 at MethodHandlesFindSpecialRepresentationTest.doTest(MethodHandlesLookupTests.kt:22) |
@@ -26,13 +26,11 @@ Detailed trace:
2626
| value ➜ 0 at CounterDerived.increment(MethodHandlesLookupTests.kt:178) |
2727
| value = 2 at CounterDerived.increment(MethodHandlesLookupTests.kt:178) |
2828
| Special#1.invoke(CounterDerived#1) at MethodHandlesFindSpecialRepresentationTest.doTest(MethodHandlesLookupTests.kt:30) |
29-
| MethodHandle.linkToSpecial(CounterDerived#1, MemberName#1) at DirectMethodHandle$Holder.invokeSpecial(DirectMethodHandle$Holder:0) |
30-
| CounterDerived#1.value ➜ 2 at Counter.increment(MethodHandlesLookupTests.kt:158) |
31-
| CounterDerived#1.value = 3 at Counter.increment(MethodHandlesLookupTests.kt:158) |
29+
| CounterDerived#1.value ➜ 2 at Counter.increment(MethodHandlesLookupTests.kt:158) |
30+
| CounterDerived#1.value = 3 at Counter.increment(MethodHandlesLookupTests.kt:158) |
3231
| Special#1.invokeExact(CounterDerived#1) at MethodHandlesFindSpecialRepresentationTest.doTest(MethodHandlesLookupTests.kt:31) |
33-
| MethodHandle.linkToSpecial(CounterDerived#1, MemberName#1) at DirectMethodHandle$Holder.invokeSpecial(DirectMethodHandle$Holder:0) |
34-
| CounterDerived#1.value ➜ 3 at Counter.increment(MethodHandlesLookupTests.kt:158) |
35-
| CounterDerived#1.value = 4 at Counter.increment(MethodHandlesLookupTests.kt:158) |
32+
| CounterDerived#1.value ➜ 3 at Counter.increment(MethodHandlesLookupTests.kt:158) |
33+
| CounterDerived#1.value = 4 at Counter.increment(MethodHandlesLookupTests.kt:158) |
3634
| CounterDerived#1.value ➜ 4 at MethodHandlesFindSpecialRepresentationTest.doTest(MethodHandlesLookupTests.kt:32) |
3735
| result: IllegalStateException #1 |
3836
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)