-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix instrumentation of newly loaded classes #525
Conversation
…med or re-defined classes) Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
This is a part of #505 |
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two nit
s: I would remove the mentioned if
-statements, but leaving them is also ok
Signed-off-by: Evgeniy Moiseenko <[email protected]>
I also thought it should be no-op, but unfortunately without the surrounding I don't know what exactly is the reason, could be some bug in ByteBuddy or Kotlin compiler (e.g., maybe it decides to convert vararg argument with 0 provided arguments to I've added a comment to the code about this problem. |
src/jvm/main/org/jetbrains/kotlinx/lincheck/strategy/managed/ObjectLabelFactory.kt
Show resolved
Hide resolved
@eupp, should a test that verifies the fix be added to this PR? |
Signed-off-by: Evgeniy Moiseenko <[email protected]>
This issue manifests on the coroutines related test that I am going to add under #505. I've tried to minimize the bug but so far with no success. Normally in most cases, the lazy instrumentation would be applied to a class, for example, before the object is created:
So at the point when But if some object is created inside an ignored section, or its creation is untracked by some other reason, the |
src/jvm/test/resources/expected_logs/run_concurrent_test/anonymous_object_jdk8.txt
Outdated
Show resolved
Hide resolved
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Before this commit, the instrumentation would only be triggered for re-transformed or re-defined classes.
With this change, instrumentation is also applied to new classes loaded during Lincheck test execution.