-
Notifications
You must be signed in to change notification settings - Fork 37
Remove access calls from trace #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9bdaa98
Remove access calls from trace (for function accesses only). #537
bbrockbernd 0df8fc0
Added removal of access$get and access$set synthetic field access tra…
bbrockbernd bf34824
Update txts
bbrockbernd 612de84
Bugfix and updated txts
bbrockbernd 9167f7c
Additional access function representation output for jdk11 and higher.
bbrockbernd 0a0948a
Additional access field representation output for jdk11 and higher.
bbrockbernd cdde07a
Fix output file thread_pool.txt
bbrockbernd 892c0ee
Pr comments
bbrockbernd ef6c280
Pr comments 2
bbrockbernd 511dec2
minor + docs
eupp 0d64479
fix expected trace files for coroutines test
eupp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...st/org/jetbrains/kotlinx/lincheck_test/representation/AccessFunctionRepresentationTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Lincheck | ||
* | ||
* Copyright (C) 2019 - 2025 JetBrains s.r.o. | ||
* | ||
* This Source Code Form is subject to the terms of the | ||
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
* with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.jetbrains.kotlinx.lincheck_test.representation | ||
|
||
class AccessFunctionRepresentationTest: BaseRunConcurrentRepresentationTest<Unit>("access_function_representation_test") { | ||
|
||
@Volatile | ||
private var a = 0 | ||
|
||
override fun block() { | ||
runLambda { inc1() } | ||
check(false) | ||
} | ||
|
||
private fun inc1() { | ||
Nested().inc2() | ||
} | ||
|
||
private fun inc3() { | ||
a++ | ||
} | ||
|
||
private inner class Nested { | ||
fun inc2() { | ||
inc3() | ||
} | ||
|
||
} | ||
} | ||
|
||
private fun runLambda(r: () -> Unit) { | ||
r() | ||
} | ||
|
||
class AccessFieldRepresentationTest: BaseRunConcurrentRepresentationTest<Unit>("access_field_representation_test") { | ||
|
||
@Volatile | ||
private var a = 0 | ||
|
||
override fun block() { | ||
runLambda { a++ } | ||
check(false) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/jvm/test/resources/expected_logs/access_field_representation_test.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
= Concurrent test failed = | ||
|
||
java.lang.IllegalStateException: Check failed. | ||
at org.jetbrains.kotlinx.lincheck_test.representation.AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:50) | ||
at org.jetbrains.kotlinx.lincheck_test.representation.AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:43) | ||
at org.jetbrains.kotlinx.lincheck_test.representation.BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | ||
at java.lang.Thread.run(Thread.java:750) | ||
|
||
The following interleaving leads to the error: | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Thread 1 | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| AccessFieldRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
|
||
Detailed trace: | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Thread 1 | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| AccessFieldRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | | ||
| block(): threw IllegalStateException at AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:43) | | ||
| AccessFunctionRepresentationTestKt.runLambda(block$1#1) at AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:49) | | ||
| block$1#1.invoke() at AccessFunctionRepresentationTestKt.runLambda(AccessFunctionRepresentationTest.kt:40) | | ||
| invoke() at AccessFieldRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:49) | | ||
| AccessFieldRepresentationTest#1.a ➜ 1 at AccessFieldRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:49) | | ||
| AccessFieldRepresentationTest#1.a = 2 at AccessFieldRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:49) | | ||
| result: IllegalStateException #1 | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
28 changes: 28 additions & 0 deletions
28
src/jvm/test/resources/expected_logs/access_field_representation_test_jdk11.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
= Concurrent test failed = | ||
|
||
java.lang.IllegalStateException: Check failed. | ||
at org.jetbrains.kotlinx.lincheck_test.representation.AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:50) | ||
at org.jetbrains.kotlinx.lincheck_test.representation.AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:43) | ||
at org.jetbrains.kotlinx.lincheck_test.representation.BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | ||
at java.base/java.lang.Thread.run(Thread.java:829) | ||
|
||
The following interleaving leads to the error: | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Thread 1 | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| AccessFieldRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
|
||
Detailed trace: | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Thread 1 | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| AccessFieldRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | | ||
| block(): threw IllegalStateException at AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:43) | | ||
| AccessFunctionRepresentationTestKt.runLambda(block$1) at AccessFieldRepresentationTest.block(AccessFunctionRepresentationTest.kt:49) | | ||
| block$1.invoke() at AccessFunctionRepresentationTestKt.runLambda(AccessFunctionRepresentationTest.kt:40) | | ||
| invoke() at AccessFieldRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:49) | | ||
| AccessFieldRepresentationTest#1.a ➜ 1 at AccessFieldRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:49) | | ||
| AccessFieldRepresentationTest#1.a = 2 at AccessFieldRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:49) | | ||
| result: IllegalStateException #1 | | ||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
31 changes: 31 additions & 0 deletions
31
src/jvm/test/resources/expected_logs/access_function_representation_test.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
= Concurrent test failed = | ||
|
||
java.lang.IllegalStateException: Check failed. | ||
at org.jetbrains.kotlinx.lincheck_test.representation.AccessFunctionRepresentationTest.block(AccessFunctionRepresentationTest.kt:20) | ||
at org.jetbrains.kotlinx.lincheck_test.representation.AccessFunctionRepresentationTest.block(AccessFunctionRepresentationTest.kt:13) | ||
at org.jetbrains.kotlinx.lincheck_test.representation.BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | ||
at java.lang.Thread.run(Thread.java:750) | ||
|
||
The following interleaving leads to the error: | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| Thread 1 | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| AccessFunctionRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
|
||
Detailed trace: | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| Thread 1 | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| AccessFunctionRepresentationTest#1.block(): threw IllegalStateException at BaseRunConcurrentRepresentationTest$testRunWithModelChecker$result$1$1.invoke(RunConcurrentRepresentationTests.kt:40) | | ||
| block(): threw IllegalStateException at AccessFunctionRepresentationTest.block(AccessFunctionRepresentationTest.kt:13) | | ||
| AccessFunctionRepresentationTestKt.runLambda(block$1#1) at AccessFunctionRepresentationTest.block(AccessFunctionRepresentationTest.kt:19) | | ||
| block$1#1.invoke() at AccessFunctionRepresentationTestKt.runLambda(AccessFunctionRepresentationTest.kt:40) | | ||
| invoke() at AccessFunctionRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:19) | | ||
| AccessFunctionRepresentationTest.inc1() at AccessFunctionRepresentationTest$block$1.invoke(AccessFunctionRepresentationTest.kt:19) | | ||
| Nested#1.inc2() at AccessFunctionRepresentationTest.inc1(AccessFunctionRepresentationTest.kt:24) | | ||
| AccessFunctionRepresentationTest.inc3() at AccessFunctionRepresentationTest$Nested.inc2(AccessFunctionRepresentationTest.kt:33) | | ||
| a ➜ 1 at AccessFunctionRepresentationTest.inc3(AccessFunctionRepresentationTest.kt:28) | | ||
| a = 2 at AccessFunctionRepresentationTest.inc3(AccessFunctionRepresentationTest.kt:28) | | ||
| result: IllegalStateException #1 | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.