This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][CTU][NFC] Add an extra regression test
ClosedPublic

Authored by steakhal on Feb 12 2021, 2:09 AM.

Details

Summary

Before bc713f6a004723d1325bc16e1efc32d0ac82f939 landed, the analyzer crashed on this reduced example.
It seems important to have bot ctu and -analyzer-opt-analyze-headers enabled in the example.

This test file ensures that no regression happens in the future in this regard.

Diff Detail

Event Timeline

steakhal created this revision.Feb 12 2021, 2:09 AM
steakhal requested review of this revision.Feb 12 2021, 2:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2021, 2:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NoQ accepted this revision.Mar 3 2021, 5:34 PM

-analyzer-opt-analyze-headers

I'm actually shocked that we provide such option at all. And that it's the first option in the list in scan-build --help. And that I haven't noticed it until now despite that. How did you discover the crash? Are people actually using it?

The test is obviously nice to have.

This revision is now accepted and ready to land.Mar 3 2021, 5:34 PM
In D96586#2601856, @NoQ wrote:

-analyzer-opt-analyze-headers

I'm actually shocked that we provide such option at all. And that it's the first option in the list in scan-build --help. And that I haven't noticed it until now despite that.

I didn't know about this option either xD

How did you discover the crash? Are people actually using it?

If I remember correctly, one of our test runs, analyzing the clang's source code with shallow and deep CTU configuration crashed.
The CodeChecker was driving the analysis, but if a configuration can crash the analyzer that is a problem for sure.
We always provide this flag here.

Luckily, Richard's commit fixed this without any direct intent :D That is why I want to pin this via this regression test.

The funny thing is that no headers are involved, yet the crash depends on the -analyzer-opt-analyze-headers flag.

"Force the static analyzer to analyze functions defined in header files"

I'm not sure how can this flag influence that, as no header files are involved in this reproducer.
I didn't feel like the time not worth investigating this more thoroughly.

martong accepted this revision.Mar 8 2021, 5:27 AM

Thanks for the test!

This revision was landed with ongoing or failed builds.Mar 10 2021, 3:36 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Mar 10 2021, 3:49 AM

The test doesn't pass: http://45.33.8.238/linux/41341/step_7.txt

I think you just need to say rm -rf instead of rm -r on line 3 (?)

The test doesn't pass: http://45.33.8.238/linux/41341/step_7.txt

I think you just need to say rm -rf instead of rm -r on line 3 (?)

I hope a94ac467c2974d9afe68f3fe6cff27bd19bcfad0 fixes this.
Thanks for the heads up.

Uh, I missed mentioning this revision in the commit message. I hope it's not gonna bite back :|