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

Address Coverity mutex issues #3433

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

matt335672
Copy link
Member

Coverity has generated a number of 'Data race condition' and 'Double lock' false positives. A lot of these seem to be caused by the NULL guard in tc_mutex_unlock() not being paired with a NULL guard in tc_mutex_lock(). This PR adds a NULL guard to tc_mutex_lock().

It should be noted, that on Linux at least, passing NULL to tc_mutex_lock() causes a segfault. We clearly aren't doing this at the moment, or we'd know about it. A log message is generated if a NULL call is made, rather than failing silently.

Coverity has generated a number of 'Data race condition' and 'Double
lock' false positives. A lot of these seem to be caused by the NULL
guard in tc_mutex_unlock() not being paired with a NULL guard in
tc_mutex_lock(). This PR adds a NULL guard to tc_mutex_lock().

It should be noted, that on Linux at least, passing NULL to
tc_mutex_lock() causes a segfault. We clearly aren't doing this at the
moment, or we'd know about it. A log message is generated if a NULL
call is made, rather than failing silently.
@matt335672 matt335672 merged commit 6889a07 into neutrinolabs:devel Feb 14, 2025
14 checks passed
@matt335672 matt335672 deleted the coverity_scan branch February 14, 2025 17:09
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