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

kernel/acct.c: acct_get(): cannot annotate due to aliasing #148

Open bulwahn opened 4 years ago

bulwahn commented 4 years ago
kernel/acct.c:168:1: warning: mutex 'res->lock' is not held on every path through here [-Wthread-safety-analysis]
}
^
kernel/acct.c:161:2: note: mutex acquired here
        mutex_lock(&res->lock);
        ^

We cannot annotate this function, as res is a local variable (aliasing issue & use of a function in assignment). If we could, we annotate it with __try_acquires_mutex.