ClangBuiltLinux / thread-safety-analysis

A research project into applying Clang's Thread Safety Analysis to the Linux Kernel
Other
6 stars 0 forks source link

net/unix/af_unix.c: unix_dgram_recvmsg: control flow too complicated to handle #122

Open bulwahn opened 5 years ago

bulwahn commented 5 years ago
net/unix/af_unix.c:2059:4: warning: mutex 'u->iolock' is not held on every path through here [-Wthread-safety-analysis]
                        break;
                        ^
net/unix/af_unix.c:2053:3: note: mutex acquired here
                mutex_lock(&u->iolock);
                ^
net/unix/af_unix.c:2133:2: warning: releasing mutex 'u->iolock' that was not held [-Wthread-safety-analysis]
        mutex_unlock(&u->iolock);
        ^

Control flow is coupled with certain values that are passed around. Clang cannot infer that here.