Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-20 Thread Phabricator via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-19 Thread Anna Zaks via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-18 Thread Zoltán Dániel Török via cfe-commits
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?

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-14 Thread Anna Zaks via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-14 Thread Zoltán Dániel Török via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-14 Thread Zoltán Dániel Török via cfe-commits
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:

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-12 Thread Artem Dergachev via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-09-05 Thread Zoltán Dániel Török via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-06-20 Thread Anna Zaks via cfe-commits
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

Re: [PATCH] D21506: [analyzer] Block in critical section

2016-06-20 Thread Artem Dergachev via cfe-commits
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.

[PATCH] D21506: [analyzer] Block in critical section

2016-06-19 Thread Zoltán Dániel Török via cfe-commits
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.)