Repository navigation
Try again to fix Coverity warning in SDL Sound - #3005
Conversation
|
I'm not sure what's wrong with the macOS build. I've seen it fail like this before randomly. I think this is the machine you run locally @kcgen ?
|
kcgen
left a comment
There was a problem hiding this comment.
Looks good, @weirddan455.
Let's see what Coverity thinks.
Yes - this has eluded me. The machine runs a single GitHub's "runner" process; it's in charge of managing its workspace where it checks out the project and run the CI commands. The runs happen serially, usually with a couple seconds between back-to-back runs. When it goes off the rails, Meson reports that a bunch of critical project files are missing - like in this case, My only hunch is that there's some kind of race-condition where the runner purges the content from a running job, and it impacts the current job, because the runner does re-use the same directory tree for subsequent jobs. I've stopped the runner, purged all the directories, and restarted it - for what it's worth (probably nothing 🤦 ). There isn't much to configure with the runners - you tie them into a project, point the runner service to its workspace area, and just let it run. |
Description
The previous PR did not solve the issue. Coverity saw my assert and still thinks it's freeing from the middle of the list.
It's possible it is seeing a data race. I've removed the use of the volatile keyword and used a mutex lock around the entire loop.
Sound_FreeSamplealso takes a lock but SDL's mutex is recursive so this should be fine.This also removes a temporary variable that was maybe confusing Coverity. Now
Sound_FreeSampleis explicitly being called withsample_list(head of the linked list).Related issues
#2996
Manual testing
Started Quake with ripped .ogg sound files. Closed Dosbox and confirmed there was no crashes or deadlocks.
Checklist
Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.
I have: