[MDEV-26574] An improper locking bug due to unreleased lock in the ds_xbstream.cc Created: 2021-09-08  Updated: 2021-09-15  Resolved: 2021-09-15

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.6.4
Fix Version/s: 10.2.41, 10.3.32, 10.4.22, 10.5.13, 10.6.5

Type: Bug Priority: Blocker
Reporter: Ryan Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: code, performance, server
Environment:

All



 Description   

The lock stream_ctxt->mutex is not released correctly when stream_ctxt->dest_file == NULL in the function xbstream_open
https://github.com/MariaDB/server/blob/76f4a78ba2639b5abd01a88b24a3c509c11530ce/extra/mariabackup/ds_xbstream.cc#L126-L133

Also mentioned in MDEV-26556.



 Comments   
Comment by Vladislav Vaintroub [ 2021-09-15 ]

Actually, this code is not even compiled. Perhaps you can adjust your static analyzer to work better with CMake. Actually, well, no. that code is bug description is compiled, but ds_archive.cc in the title is not compiled.

Comment by Ryan [ 2021-09-15 ]

Sorry, I made a mistake on the title. Should be a real bug in the ds_xbstream.cc?

Comment by Vladislav Vaintroub [ 2021-09-15 ]

Maybe. At least it looked obvious enough to fix.

Comment by Ryan [ 2021-09-15 ]

Thanks, there are some other similar cases I found.

Generated at Thu Feb 08 09:46:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.