Coverity static analysis findings - July 2026 - #6432
Conversation
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
|
| Filename | Overview |
|---|---|
| dali/pipeline/util/worker_thread.cc | Fixes MISSING_LOCK/LOCK_EVASION by unconditionally calling WaitForWork+ForceStop in Shutdown(), and fixes UNCAUGHT_EXCEPT by wrapping DeviceGuard in std::optional so construction happens inside the try block. Both changes are correct. |
| dali/pipeline/util/thread_pool.cc | Moves tl_errors_.resize(num_thread) before thread launch to eliminate the race where a newly started thread could push to an undersized tl_errors_ vector. The pre-existing DeviceGuard-before-try issue in OldThreadPool::ThreadMain was flagged by a prior reviewer and is not addressed here. |
Sequence Diagram
sequenceDiagram
participant Caller
participant Shutdown
participant WaitForWork
participant ForceStop
participant WorkerThread
Note over Caller,WorkerThread: New Shutdown() flow
Caller->>Shutdown: Shutdown()
Shutdown->>WaitForWork: WaitForWork(false)
Note over WaitForWork: Returns immediately if work_complete_ or not running_
WaitForWork-->>Shutdown: returns
Shutdown->>ForceStop: ForceStop()
Note over ForceStop: Sets running_=false under lock, barrier_.Break(), cv_.notify_all()
ForceStop-->>WorkerThread: wakes up via cv or barrier
WorkerThread-->>WorkerThread: "sees running_=false, exits loop"
ForceStop-->>Shutdown: returns
Shutdown->>Shutdown: thread_.join()
WorkerThread-->>Shutdown: thread exits
Reviews (3): Last reviewed commit: "Revert fixes for false positives" | Re-trigger Greptile
|
CI MESSAGE: [59265987]: BUILD STARTED |
|
CI MESSAGE: [59265987]: BUILD PASSED |
| } | ||
| #endif | ||
| } catch (...) { | ||
| tl_errors_[thread_id].push(std::current_exception()); |
There was a problem hiding this comment.
Missing running_ = false; here - but should we terminate the thread in case of NVML errors, too? I don't know that.
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
Category:
Other (e.g. Documentation, Tests, Configuration)
Description:
Issues fixed
MISSING_LOCK) and 27279471 (LOCK_EVASION)running_and the check-then-lock pattern.UNCAUGHT_EXCEPT)DeviceGuardconstruction inside the existing exception handler while preserving its lifetime for the whole worker thread.Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Were some of the fixed issues false positives?
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-4805