This is an archive of the discontinued LLVM Phabricator instance.

CStringChecker can crash when uninitialized checks are disabled
AbandonedPublic

Authored by vlad.tsyrklevich on Jan 16 2017, 3:09 AM.

Details

Summary

CStringChecker assumes that SVals are not undefined at two points with comments stating that other checkers will check for that condition first; however, it can crash if a user chooses a particular configuration. I hit such an unlucky configuration while eliminating false positive heavy checks analyzing the Linux kernel and tracked down the crashes to this assumption.

Add UndefinedVal checks where appropriate.

Diff Detail

Event Timeline

vlad.tsyrklevich retitled this revision from to CStringChecker can crash when uninitialized checks are disabled.
vlad.tsyrklevich updated this object.

It is not supported to run the analyzer with some of the core checkers turned off. Maybe we should change the behavior such that turning off core checkers turn off the warnings from those checkers but not the checkers themselves?

zaks.anna edited edge metadata.Jan 19 2017, 10:14 AM

It is not supported to run the analyzer with some of the core checkers turned off.

Correct.

Maybe we should change the behavior such that turning off core checkers turn off the warnings from those checkers but not the checkers themselves?

Having this as the default behavior for "disable a checker" could be confusing. however, introducing a new flag for silencing warnings from a checker sounds fine.

What is the motivation for disabling the core checkers in this particular case?

vlad.tsyrklevich abandoned this revision.Jan 19 2017, 11:41 PM

The motivation was to make resulting output easier to navigate and to cut the result size by ~90%, one default run against the FreeBSD kernel takes 3 gigs of storage and I'm running several builds a day as I iterate on checks. I did not realize that running without core was unsupported. A silencing flag would have done the trick.

You might want to give CodeChecker [1] a try as a workaround. It stores the results in a more compact format and you can do filtering.

[1] https://github.com/Ericsson/codechecker