Skip to content

[Coverity][UR] Potential double-unlock of a mutex in the L0 adapter #20726

@AlexeySachkov

Description

@AlexeySachkov

Reported by Coverity as CID 520793, you can access Coverity results here: https://scan.coverity.com/projects/intel-llvm?tab=overview

The following piece of code:

if (Queue && Queue != CurQueue) {
CurQueue->Mutex.unlock();
QueueLock = std::unique_lock<ur_shared_mutex>(Queue->Mutex);
}

Is located within a loop:

for (uint32_t I = 0; I < EventListLength; I++) {
{

Meaning, that we may call CurQueue->Mutex.unlock(); multiple times. That mutex is a std::shared_mutex whose unlock method behavior is undefined if a mutex is already unlocked.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions