This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Suppress more MallocChecker positives in reference counting pointer destructors.
ClosedPublic

Authored by NoQ on Mar 8 2018, 5:10 PM.

Details

Summary

D43791 wasn't quite enough because we often run out of inlining stack depth limit and for that reason fail to see the atomics we're looking for.

Add a more straightforward false positive suppression that is based on the name of the class. I.e. if we're releasing a pointer in a destructor of a "something shared/intrusive/reference/counting something ptr/pointer something", then any use-after-free or double-free that occurs later would likely be a false positive.

Diff Detail

Repository
rC Clang

Event Timeline

NoQ created this revision.Mar 8 2018, 5:10 PM

we often run out of inlining stack depth limit

Can we consider increasing that limit? I'd much rather have a limit on maximum path *length* (which we currently don't have), as longer paths are more likely to be false positives.
On the other hand, I don't see that many issues with paths which perform too many inlinings.

lib/StaticAnalyzer/Checkers/MallocChecker.cpp
2836

There's lib/Support/Regex.cpp?

2903–2924

auto

NoQ updated this revision to Diff 139231.Mar 20 2018, 5:10 PM
  • fix auto.
  • don't use regexs yet because it's clean enough anyway; maybe later.
NoQ marked an inline comment as done.Mar 20 2018, 5:10 PM
george.karpenkov accepted this revision.Mar 20 2018, 5:38 PM
This revision is now accepted and ready to land.Mar 20 2018, 5:38 PM
This revision was automatically updated to reflect the committed changes.