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

Possible patch for POSIX conditional wait issue #356

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Sep 29, 2023

Fixes ZD 16769

@dgarske dgarske self-assigned this Sep 29, 2023
@dgarske dgarske requested a review from embhorn October 2, 2023 15:22
@dgarske dgarske assigned embhorn and unassigned dgarske Oct 2, 2023
pthread_mutex_lock(&s->mutex);
s->lockCount--;
pthread_cond_signal(&s->cond);
if (s->lockCount > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Should the else case here return an error code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't handle the wm_SemUnlock return code anywhere in wolfMQTT. However I will run some tests and see if this case ever occurs. I suspect it might and that's okay and should not be considered an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our test cases aren't triggering it, however I think with the complicated locks in the state machine for lockRecv with the right abort this might be able to occur. Ignoring it is safe "in my opinion".

@dgarske dgarske assigned dgarske and unassigned dgarske Oct 2, 2023
@embhorn embhorn self-requested a review October 2, 2023 17:50
@embhorn embhorn merged commit 46845c6 into wolfSSL:master Oct 2, 2023
6 checks passed
@dgarske dgarske deleted the cond_wait branch November 7, 2023 21:29
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