]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect/loader: add threading coverity warning
authorVictor Julien <vjulien@oisf.net>
Sat, 21 Jun 2025 10:42:17 +0000 (12:42 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 21 Jun 2025 19:32:54 +0000 (21:32 +0200)
commit65ff3dfa88504320179317e7a9834213a0279a6e
tree70654389f9056e58362562867ebcdd918ebf1039
parent5aaef39c8c727cf44c5a0142285e5e6ed65e9c11
detect/loader: add threading coverity warning

 lock_acquire: Calling pthread_mutex_lock acquires lock ThreadVars_.ctrl_mutex.
725        SCCtrlMutexLock(th_v->ctrl_mutex);

CID 1554214: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock ThreadVars_.ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.
src/detect-engine-loader.c