Page MenuHomePhabricator
Feed Advanced Search

Aug 16 2017

malhar1995 updated the diff for D36441: Add Support for Reference Counting of Parameters on the Callee Side in RetainCountChecker.

This patch adds the functionality of performing reference counting on the callee side for Integer Set Library (ISL) to Clang Static Analyzer's RetainCountChecker.

Aug 16 2017, 2:33 PM

Aug 9 2017

malhar1995 updated the diff for D36441: Add Support for Reference Counting of Parameters on the Callee Side in RetainCountChecker.

Addressed comments.

Aug 9 2017, 8:07 PM

Aug 7 2017

malhar1995 added inline comments to D36441: Add Support for Reference Counting of Parameters on the Callee Side in RetainCountChecker.
Aug 7 2017, 10:03 PM
malhar1995 created D36441: Add Support for Reference Counting of Parameters on the Callee Side in RetainCountChecker.
Aug 7 2017, 9:49 PM

Jul 22 2017

malhar1995 added a comment to D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker.

@dcoughlin Ping.

Jul 22 2017, 6:14 AM · Restricted Project

Jul 20 2017

malhar1995 updated the diff for D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker.

Removed the checks to see if the symbol type is NULL while printing diagnostics as they are unnecessary.

Jul 20 2017, 3:05 AM · Restricted Project
malhar1995 added inline comments to D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker.
Jul 20 2017, 2:26 AM · Restricted Project

Jul 19 2017

malhar1995 updated the diff for D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker.

Addressed all comments except the one where I had to remove the test to see if the return type was null while emitting diagnostics.

Jul 19 2017, 11:36 AM · Restricted Project
malhar1995 added reviewers for D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker: NoQ, zaks.anna.
Jul 19 2017, 7:16 AM · Restricted Project
malhar1995 created D35613: Add Support for Generic Reference Counting Annotations in RetainCountChecker.
Jul 19 2017, 1:26 AM · Restricted Project

Jul 17 2017

malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Added isTrustedReferenceCountAnnotation() again.

Jul 17 2017, 11:17 PM
malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Addressed comments.
Changed the function from isTrustedReferenceCountImplementation() to hasRCAnnotation() (I'm unable to come up with a better name) as this will be useful when I add support to RetainCountChecker to check for generic annotations corresponding to isl_give(cf_returns_retained) and isl_take(cf_consumed).

Jul 17 2017, 11:51 AM
malhar1995 added a comment to D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Looks good to me, other than a nit on indentation and a request for a little bit more info in a comment!

Jul 17 2017, 10:43 AM

Jul 15 2017

malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Checked for "trusted" annotation on the function declaration corresponding to the function definition.

Jul 15 2017, 2:50 AM

Jul 14 2017

malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Suppresses false positives involving functions which perform reference counting.
Added relevant test-cases to test/Analysis/retain-release-inline.m

Jul 14 2017, 11:57 AM
malhar1995 updated the summary of D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.
Jul 14 2017, 11:53 AM

Jul 5 2017

malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Corrected one of the two test-cases added in the last-diff.

Jul 5 2017, 10:01 AM
malhar1995 added a comment to D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Thanks for the tests.

Have you tried this on the ISL codebase to make sure it is suppressing the diagnostics in related to reference counting implementation that you expect?

I think it would be good to add some tests that reflect the reference counting implementation patterns in ISL that you want to make sure not to warn on. Can you simplify those patterns to their essence and add them as tests?

Jul 5 2017, 6:56 AM

Jul 4 2017

malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Added relevant test-cases to verify the added functionality.

Jul 4 2017, 10:15 AM
malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.

Changed function name from 'isAnnotatedToSkipDiagnostics' to 'isTrustedReferenceCountImplementation'.
Added some test-cases to test/Analysis/retain-release-inline.m.
Applied clang-format to the changed code.

Jul 4 2017, 5:45 AM

Jul 3 2017

malhar1995 updated the diff for D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.
Jul 3 2017, 7:33 AM
malhar1995 created D34937: Suppressing Reference Counting Diagnostics for Functions Containing 'rc_ownership_trusted_implementation' Annotate Attribute.
Jul 3 2017, 7:33 AM

May 23 2017

malhar1995 updated the diff for D32449: Modifying PthreadLockChecker.cpp to reduce false positives..

Applied clang-format only to the changed lines in the final code.

May 23 2017, 12:23 PM
malhar1995 added a comment to D32449: Modifying PthreadLockChecker.cpp to reduce false positives..
In D32449#761303, @NoQ wrote:

Thanks, this is great! Two more things:

  • You have touched other code, unrelated to your patch, with clang-format; we're usually trying to avoid that, because it creates merge conflicts out of nowhere, and because some of that code actually seems formatted by hand intentionally. It's better to revert these changes; you can use the git clang-format thing to format only actual changes.

I did not apply clang-format to any file except for PthreadLockChecker.cpp. Do you think the merge conflict is due to me not applying clang-format to test/Analysis/pthreadlock.c? The only files I changed were .gitignore, PthreadLockChecker.cpp and test/Analysis/pthreadlock.c.
Also, when you asked me to revert the changes, did you mean revert the changes made by clang-format? If yes, how do I do that?
I apologize for asking such silly questions. The thing is I'm new to all this and I don't really know how to proceed further.

  • Updating .gitignore sounds like the right thing to do (llvm's .gitignore already has this), but i guess we'd better make a separate commit for that.
May 23 2017, 7:43 AM

May 22 2017

malhar1995 updated the diff for D32449: Modifying PthreadLockChecker.cpp to reduce false positives..

Addressed previous comments (removed Schrodinger from lock state names, changed method name setAppropriateLockState to resolvePossiblyDestroyedMutex, added an assert in resolvePossiblyDestroyedMutex, formatted the code using clang-format and added some test-cases to test/Analysis/pthreadlock.c)

May 22 2017, 6:10 AM

May 20 2017

malhar1995 added inline comments to D32449: Modifying PthreadLockChecker.cpp to reduce false positives..
May 20 2017, 9:41 AM
malhar1995 added a comment to D32449: Modifying PthreadLockChecker.cpp to reduce false positives..
In D32449#760141, @NoQ wrote:

Thanks! Your code looks very clear now, and it seems correct to me.

One last thing we definitely should do here would be add regression tests for the new functionality. I guess you already have your tests, otherwise you wouldn't know if your code works, so you'd just need to append them to the patch, somewhere at the bottom of test/Analysis/pthreadlock.c, and make sure that make -j4 check-clang-analysis passes. Ideally, we should cover as many branches as possible.

A few ideas of what to test (you might have thought about most of them already, and i expect them to actually work by just looking at what your code accomplishes):

  • What we can/cannot do with the mutex in the failed-to-be-destroyed state, depending on the state of the mutex before destruction was attempted.
  • What we can/cannot do with the mutex in each of the "Schrodinger" states - in particular, do we display the double-destroy warning in such cases?
  • How return-symbol death races against resolving success of the destroy operation: what if the programmer first tries to destroy mutex, then uses the mutex, then checks the return value?
  • Are you sure we cannot assert(lstate) on line 137? - a test could be added that would cause such assertion to fail if someone tries to impose it.

    Apart from that, i guess it'd be good to use more informative variable names in a few places (see inline comments), and fix the formatting, i.e. spaces and line breaks (should be easy with clang-format). Also you shouldn't add the .DS_Store files :) And then we'd accept and commit this patch.
May 20 2017, 5:54 AM

May 17 2017

malhar1995 updated the diff for D32449: Modifying PthreadLockChecker.cpp to reduce false positives..

Cleaned up the previous patch.
Added checking of LockState before initializing a mutex as well.
Added separate branches of execution for PthreadSemantics and XNUSemantics.
Added assert in case of checkDeadSymbols as existence in DestroyRetVal ensures existence in LockMap.

May 17 2017, 8:38 PM

May 16 2017

malhar1995 updated the diff for D32449: Modifying PthreadLockChecker.cpp to reduce false positives..

Added context.
Also, I removed the inclusion of iostream and also added the repetitive code to the function setAppropriateLockState.
Currently working on finding various corner cases and invariants.

May 16 2017, 12:32 PM

Apr 24 2017

malhar1995 created D32449: Modifying PthreadLockChecker.cpp to reduce false positives..
Apr 24 2017, 12:13 PM