[llvm-bugs] [Bug 32455] New: False Positive PthreadLockChecker Use destroyed lock

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 29 02:19:45 PDT 2017


            Bug ID: 32455
           Summary: False Positive PthreadLockChecker Use destroyed lock
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: xiangzhai83 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi LLVM developers,

Testcase: libburn

209      if(pthread_mutex_destroy(&(o->lock_mutex))!=0) {
          Assuming the condition is true        

          Taking true branch    

210        pthread_mutex_unlock(&(o->lock_mutex));
           This lock has already been destroyed

211        pthread_mutex_destroy(&(o->lock_mutex));
212      }
213     #endif

But if the return value of pthread_mutex_destroy is NOT 0
then mutex->__data.__kind will not be set! so it might be still able to use
pthread_mutex_unlock to set mutex object's members

Leslie Zhai

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170329/dfad6fce/attachment.html>

More information about the llvm-bugs mailing list