This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] move NewDeleteLeaks checker from alpha.cplusplus to cplusplus group.
Needs ReviewPublic

Authored by ayartsev on Sep 11 2014, 1:55 PM.

Details

Reviewers
jordan_rose
Summary

Once again ran NeweleteLeaks over the LLVM codebase and addressed all leak reports. The majority of them are related to mangling the address of a pointer, several reports are real leaks, the rest are single rare cases.
Is it OK now to turn the checker on?

Diff Detail

Event Timeline

ayartsev updated this revision to Diff 13594.Sep 11 2014, 1:55 PM
ayartsev retitled this revision from to [analyzer] move NewDeleteLeaks checker from alpha.cplusplus to cplusplus group..
ayartsev updated this object.
ayartsev edited the test plan for this revision. (Show Details)
ayartsev added a reviewer: jordan_rose.
ayartsev added a subscriber: Unknown Object (MLST).

Attached is the report with all the leaks from the last analyzer run (10.09.2014) addressed. Minimal tests are included for all types of false-positives.

jordan_rose edited edge metadata.Sep 16 2014, 9:51 AM

Thanks for running the tests! I'm surprised we have trouble with test4.cpp, but the others all do seem like known issues. I'd like to check with Anna or Ted as well before turning this on for real.

lib/StaticAnalyzer/Core/ExprEngineC.cpp
903 ↗(On Diff #13594)

This snuck in somehow?

ayartsev updated this revision to Diff 13766.Sep 16 2014, 3:29 PM
ayartsev edited edge metadata.
ayartsev added subscribers: krememek, zaks.anna.

Cleaned the patch.
Anna, Ted, do you think the NeweleteLeaks checker is ready for being turned on?

Anton,

Have you tested this on any C++ codebase other than LLVM? It would be really great to confirm the results by testing this on a different project.

Hi all,

Currently managed to launch the analyzer only on the Ogre
(http://www.ogre3d.org/download/source) codebase using different hacks
and tricks. The analyzer found a single leak - a known type of
false-positives related to the bit mangling. Attached is the report from
the analyzer. I think it's a good result as Ogre extensively allocates
memory in different ways and we haven't got tons of false-positives. To
ensure that the analyzer works correctly I injected a leaky code in the
Ogre codebase and the analyzer successfully found it.

The last weeks I'm trying to launch the analyzer on the QT5 codebase.
Currently found at least 4 defects in the scan-build/ccc-analyzer
scripts preventing me from successful run. Also tried to launch the
analyzer over several small projects but failed. The scan-build is far
from being production-quality. Currently working on the defects.

Anton,

Have you tested this on any C++ codebase other than LLVM? It would be really great to confirm the results by testing this on a different project.

http://reviews.llvm.org/D5313

Anton,

Thank you for running the extra tests! Please, go ahead and turn on the checker when you are ready.

Thank you,
Anna.

Committed at r220289.