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

Bugfix for wait-notify support in presence of lock re-entrance #145

Merged
merged 6 commits into from
Jun 21, 2023

Conversation

eupp
Copy link
Collaborator

@eupp eupp commented Mar 9, 2023

In current implementation of MonitorTracker in model checking strategy, the monitor re-entrance information is lost when thread performs wait operation on some object. Thus upon wake-up the model checker just re-acquires a monitor once, but does not restore previous monitor re-entrance counter. This leads to a bug (see the new test added in this PR).

This PR fixes this problem by saving the information about lock re-entrance and then correctly restoring it.

@eupp eupp requested a review from ndkoval March 9, 2023 11:43
@eupp eupp force-pushed the monitor-tracker-fix branch from 6a860c5 to b2b4dd1 Compare May 22, 2023 23:27
@eupp eupp changed the base branch from master to develop May 22, 2023 23:27
@eupp
Copy link
Collaborator Author

eupp commented May 22, 2023

@ndkoval could you please also have a look at this.

Copy link
Collaborator

@ndkoval ndkoval left a comment

Choose a reason for hiding this comment

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

The PR looks good to me. I have just a couple of minor suggestions.

Signed-off-by: Evgenii Moiseenko <[email protected]>
@eupp eupp requested a review from ndkoval June 20, 2023 20:20
ndkoval added 2 commits June 21, 2023 10:40
# Conflicts:
#	src/jvm/main/org/jetbrains/kotlinx/lincheck/strategy/managed/ManagedStrategy.kt
@ndkoval ndkoval merged commit dac9994 into develop Jun 21, 2023
@ndkoval ndkoval deleted the monitor-tracker-fix branch June 21, 2023 10:27
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.

2 participants