Skip to content
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

New model checker algorithm #410

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from
Draft

New model checker algorithm #410

wants to merge 48 commits into from

Conversation

eupp
Copy link
Collaborator

@eupp eupp commented Oct 2, 2024

No description provided.

eupp added 30 commits October 1, 2024 19:23
Signed-off-by: Evgeniy Moiseenko <[email protected]>
* fix monitor tests

* fix parking tests (use Unsafe for reflective memory locations read/writes)

* fix few bugs by adding `runInIgnoredSection`

Signed-off-by: Evgeniy Moiseenko <[email protected]>
* fix `patchResultsClock` function

* remove redundant `AtomicLongTest`

* fix delta in managed strategy handler of `getAndIncrement()` and similar methods

* remove obsolete code from EventStructureMemoryTracker

* perform physical write to memory on successful CAS

Signed-off-by: Evgeniy Moiseenko <[email protected]>
* track constructor calls to track allocations of objects whose base classes are not instrumented

Signed-off-by: Evgeniy Moiseenko <[email protected]>
* move `loopDetector.initialize()` into `ManagedStrategy.initializeInvocation`

* comment debug byte-code printing

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
* fix `getFieldAccessMemoryLocation` (use actual runtime object's class name instead of compile-time access class name)

* minor clean-up in MemoryTracker.kt

Signed-off-by: Evgeniy Moiseenko <[email protected]>
…entstruct-mc branch

Signed-off-by: Evgeniy Moiseenko <[email protected]>
… new invocation and on new actor start)

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
* fix type computation for VarHandle accesses

Signed-off-by: Evgeniy Moiseenko <[email protected]>
* testing new model checking strategy

* ensure that the object read from an intercepted read is transformed

* repair primitives tests

* repair `VarHandleLocalObjectsTest`

Signed-off-by: Evgeniy Moiseenko <[email protected]>
* fix expected outcomes for `testLincheckPromptCancellation`

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
eupp added 17 commits October 1, 2024 19:23
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
… revisit this!)

* decrease the number of loop iterations inside test's `operation()`,
  because currently large number of iterations triggers false-positive live-lock failure,
  due to naive implementation of spin-loops detection

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
* So, apparently, the `context` used in the `ParallelThreadsRunner::Completion`
  can somehow escape between different invocations of the test.
  If this happens, everything becomes really FUCKED UP, and I spent hours trying to debug it.
  It leads to a situation, when on the new run of the test, an old `ParallelThreadRunnerInterceptor` object
  (stored in the `context`) from the previous invocation is used instead.
  To fix the issue, I changed the `Completion::reset` logic.
  Instead of creating new interceptor object, I re-use the same object by reset its state.
  Since we only use completions in a very specific way in `ParallelThreadsRunner`
  (basically one separate completion object for each suspending actor)
  this should not, in theory, lead to any problem.
  Still, only Gods know if this is truly correct way to fix this.

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
@@ -250,13 +254,27 @@ public static void afterReflectiveSetter(Object receiver, Object value) {
getEventTracker().afterReflectiveSetter(receiver, value);
}

public static void onArrayCopy(Object srcArray, int srcPos, Object dstArray, int dstPos, int length) {
getEventTracker().onArrayCopy(srcArray, srcPos, dstArray, dstPos, length);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment about System.arraycopy

boolean isStatic, boolean isFinal) {
if (!isStatic && obj == null) return false; // Ignore, NullPointerException will be thrown
return getEventTracker().beforeReadField(obj, className, fieldName, codeLocation, isStatic, isFinal);
return getEventTracker().beforeReadField(obj, className, fieldName, typeDescriptor, codeLocation, isStatic, isFinal);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-check if typeDescriptor is required (find its usages).

Signed-off-by: Evgeniy Moiseenko <[email protected]>
@eupp eupp mentioned this pull request Oct 3, 2024
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant