Skip to content

Conversation

@gc00
Copy link
Collaborator

@gc00 gc00 commented May 31, 2024

  • This case was forgotten in the implementation in 9f5fc3b

@maxwellpirtle ,

FROM @gc00: After I created this PR, I realized that we don't really need it. We check for uninitialized cond in transitions/cond/MCEnqueue.cpp already. And McMini should guarantee that that will always precede transitions/cond/MWait.cpp . We could push in this PR, or just push in the comments that remind us that MCEnqueue already checks for uninitialized cond vars.

(I originally was tracking down the bug for sleep sets that we discussed. But at first, I wrongly diagnosed it as an uninitialized cond var in pthread_cond_wait.)

Could you check the logic carefully for this? I'm worried about the case in which the cond var was initialized, but maybe the mutex argument was never initialized.

Could you look at this soon? I don't want to push any other PRs in, until we can push this PR with the bug fix. Otherwise, our history would have several commits in the environment of an obscure bug.

Typically, the user should enclose pthread_cond_wait inside a pthread_mutex_lock/unlock. But maybe some user forgot to do that, or had used a different mutex for the lock/unlock. We need McMini to catch this bug.

@gc00 gc00 added effort: 2 Requires some effort to complete type: bug-fix The PR resolves a bug. The bug need not be explicitly marked via an issue labels May 31, 2024
@gc00 gc00 requested a review from maxwellpirtle May 31, 2024 20:44
 * This case was forgotten in the implementation in 9f5fc3b
@gc00 gc00 force-pushed the fix-cond-wait-initializer branch from b3c2b16 to ece8633 Compare June 3, 2024 14:47
Copy link
Collaborator

@maxwellpirtle maxwellpirtle left a comment

Choose a reason for hiding this comment

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

We've discussed these changes together

@gc00 gc00 force-pushed the main branch 2 times, most recently from 8dabc7e to 813d1b6 Compare July 16, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort: 2 Requires some effort to complete type: bug-fix The PR resolves a bug. The bug need not be explicitly marked via an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants