This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] NFC: RetainCountChecker: Avoid dumping symbols during normal operation.
ClosedPublic

Authored by NoQ on Oct 2 2018, 2:38 PM.

Details

Summary

The checker was trying to produce a separate ProgramPointTag for every dead symbol it cleans up, so that to potentially be able to produce a separate ExplodedNode for every symbol, and for that purpose it was dumping the symbol into a string stream.

We don't need a separate node for every symbol, because whenever the first symbol leaks, a bug is emitted, the analysis is sinked, and the checker callback immediately returns due to State variable turning into null, so we never get to see the second leaking symbol.

Then, even if we needed a separate node for every symbol, it'd be much better to print the raw pointer than pretty-print the symbol, because pointers are more unique. Additionally, we are no longer able to break normal analysis while experimenting with debug dumps, which is exactly how this behavior got noticed - we noticed a crash similar to D52756 on a buildbot that definitely doesn't dump exploded graphs.

Because D52756 has already landed, this patch doesn't change the actual behavior of the Analyzer, just prevents future bugs.

Diff Detail

Repository
rC Clang

Event Timeline

NoQ created this revision.Oct 2 2018, 2:38 PM

This should also prevent leaks.

george.karpenkov accepted this revision.Oct 2 2018, 2:51 PM
This revision is now accepted and ready to land.Oct 2 2018, 2:51 PM
This revision was automatically updated to reflect the committed changes.