This revision was automatically updated to reflect the committed changes.
Closed by commit rL282011: [analyzer] Add a checker that detects blocks in
critical sections (authored by zaks).
Changed prior to commit:
https://reviews.llvm.org/D21506?vs=71375=71977#toc
Repository:
rL LLVM
zaks.anna added a comment.
This checker is now in alpha.unix, because it is new and is in active
development. However, alpha checkers are not supported and are not turned on by
default, so we should move it into unix package once we think it is ready to be
used.
Evaluation on a large real
zdtorok added a comment.
As it's my first contribution I think I have no commit access.
So far I could not test it on larger codebase. I've tried to do so on clang but
my computer was too slow for that. I will try it again.
What you mean by alpha-phase? What should be the next steps now?
zaks.anna accepted this revision.
zaks.anna added a comment.
This revision is now accepted and ready to land.
LGTM! Thanks!
Future steps:
How do we plan to bring this checker out of alpha? Have you evaluated it on
large codebases?
Repository:
rL LLVM
https://reviews.llvm.org/D21506
zdtorok added a comment.
You are right NoQ, thank you for the remark, I've upload a new diff containing
a fix for the integer underflow case.
Repository:
rL LLVM
https://reviews.llvm.org/D21506
___
cfe-commits mailing list
zdtorok updated this revision to Diff 71375.
zdtorok added a comment.
Herald added subscribers: mgorny, beanz.
Fixed possible integer-underflow in case of unexpected unlocking function. Also
added test for this.
Repository:
rL LLVM
https://reviews.llvm.org/D21506
Files:
NoQ added a comment.
I think there's still this problem i've outlined in the comment above: you can
step into an integer-underflow if your analysis begins with unlock(). You could
just ignore all unlocks that move you below 0, which would be ok.
Could you add this test?
std::mutex m;
void
zdtorok removed rL LLVM as the repository for this revision.
zdtorok updated this revision to Diff 70345.
zdtorok marked an inline comment as done.
zdtorok added a comment.
Fixed based on the provided comments and feedbacks.
- added new inter-procedural tests
- minor styling fix (trailing
zaks.anna added a comment.
Thanks for the patch!
Have you run this on a large codebase?
Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:406
@@ +405,3 @@
+def BlockInCriticalSectionChecker : Checker<"BlockInCriticalSection">,
+ HelpText<"Check for blocks in
NoQ added a comment.
Useful stuff!
When I see your approach with `mutexCount`, the following test case comes to
mind:
std::mutex m;
void foo() {
// Suppose this function is always called
// with the mutex 'm' locked.
m.unlock();
// Here probably some useful work is done.
zdtorok created this revision.
zdtorok added reviewers: zaks.anna, dcoughlin, xazax.hun.
zdtorok added a subscriber: cfe-commits.
zdtorok set the repository for this revision to rL LLVM.
This checker should find the calls to blocking functions (for example: sleep,
getc, fgets,read,recv etc.)
11 matches
Mail list logo