This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Add an example plugin for checker dependency handling
ClosedPublic

Authored by Szelethus on Mar 16 2019, 12:10 PM.

Diff Detail

Event Timeline

Szelethus created this revision.Mar 16 2019, 12:10 PM
Szelethus updated this revision to Diff 196083.Apr 22 2019, 9:29 AM
  • Move the existing plugin to test/
  • Implement the new plugin in there also
NoQ accepted this revision.May 13 2019, 2:14 PM

I can't say "no" to more tests.

This revision is now accepted and ready to land.May 13 2019, 2:14 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2019, 12:46 PM
Szelethus reopened this revision.May 15 2019, 1:20 PM

Ugh. Reverted in rC360805. Buildbots don't seem to be able to find the new plugins.

This revision is now accepted and ready to land.May 15 2019, 1:20 PM
This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.May 16 2019, 11:42 AM

All our bots are failing which seems to have been caused by the latest reland:

FAIL: Clang :: Analysis/checker-plugins.c (297 of 14793)
******************** TEST 'Clang :: Analysis/checker-plugins.c' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c    -load /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/SampleAnalyzerPlugin.so    -analyzer-checker='example.MainCallChecker'
: 'RUN: at line 15';   /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c    -load /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/CheckerDependencyHandlingAnalyzerPlugin.so   -analyzer-checker=example.DependendentChecker    -analyzer-list-enabled-checkers    2>&1 | /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/FileCheck /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-IMPLICITLY-ENABLED
: 'RUN: at line 24';   /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c    -load /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/CheckerDependencyHandlingAnalyzerPlugin.so   -analyzer-checker=example.DependendentChecker    -analyzer-disable-checker=example.Dependency    -analyzer-list-enabled-checkers    2>&1 | /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/FileCheck /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-IMPLICITLY-DISABLED
--
Exit Code: 1

Command Output (stderr):
--
error: 'error' diagnostics seen but not expected: 
  (frontend): unable to load plugin '/b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/SampleAnalyzerPlugin.so': '/b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/SampleAnalyzerPlugin.so: undefined symbol: _ZN4llvm14FoldingSetBase6anchorEv'

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 77.86s
********************
Failing Tests (1):
    Clang :: Analysis/checker-plugins.c

Is it possible to revert this change again?

Szelethus marked an inline comment as done.May 16 2019, 12:51 PM

All our bots are failing which seems to have been caused by the latest reland:

FAIL: Clang :: Analysis/checker-plugins.c (297 of 14793)
******************** TEST 'Clang :: Analysis/checker-plugins.c' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c    -load /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/SampleAnalyzerPlugin.so    -analyzer-checker='example.MainCallChecker'
: 'RUN: at line 15';   /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c    -load /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/CheckerDependencyHandlingAnalyzerPlugin.so   -analyzer-checker=example.DependendentChecker    -analyzer-list-enabled-checkers    2>&1 | /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/FileCheck /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-IMPLICITLY-ENABLED
: 'RUN: at line 24';   /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/clang -cc1 -internal-isystem /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c    -load /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/CheckerDependencyHandlingAnalyzerPlugin.so   -analyzer-checker=example.DependendentChecker    -analyzer-disable-checker=example.Dependency    -analyzer-list-enabled-checkers    2>&1 | /b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/bin/FileCheck /b/s/w/ir/k/llvm-project/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-IMPLICITLY-DISABLED
--
Exit Code: 1

Command Output (stderr):
--
error: 'error' diagnostics seen but not expected: 
  (frontend): unable to load plugin '/b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/SampleAnalyzerPlugin.so': '/b/s/w/ir/k/recipe_cleanup/clangsCGbgY/llvm_build_dir/./lib/SampleAnalyzerPlugin.so: undefined symbol: _ZN4llvm14FoldingSetBase6anchorEv'

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 77.86s
********************
Failing Tests (1):
    Clang :: Analysis/checker-plugins.c

Is it possible to revert this change again?

I started to land other patches as well that depend on this one -- I won't object, but I'd prefer to find a solution, mostly because I don't even know how I could reproduce this error. The thing is, I merely moved some files from one directory to the other, which makes me scratch my head even more. That being said -- (see inlines)

If it's urgent, feel free to revert, I won't be near a computer until tomorrow.

cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
4 ↗(On Diff #199807)

Is it possible that if we tweaked this line the error would go away?

Also, am I supposed to receive a mail from your buildbots? I unfortunately received none.

I started to land other patches as well that depend on this one -- I won't object, but I'd prefer to find a solution, mostly because I don't even know how I could reproduce this error. The thing is, I merely moved some files from one directory to the other, which makes me scratch my head even more. That being said -- (see inlines)

Which other changes have been landed that depend on this one?

Our builders always perform a clean build to avoid any dirty state from previous builds. Have you tried doing a clean build with your change?

If it's urgent, feel free to revert, I won't be near a computer until tomorrow.

If that's the case I'd prefer to revert it to avoid having the build broken for another day.

Also, am I supposed to receive a mail from your buildbots? I unfortunately received none.

We have builders on the silent master but they aren't stable enough yet to promote to the stable master.

NoQ added a comment.May 16 2019, 1:59 PM

Can we have a full build log?

I started to land other patches as well that depend on this one -- I won't object, but I'd prefer to find a solution, mostly because I don't even know how I could reproduce this error. The thing is, I merely moved some files from one directory to the other, which makes me scratch my head even more. That being said -- (see inlines)

Which other changes have been landed that depend on this one?

rC360910

Our builders always perform a clean build to avoid any dirty state from previous builds. Have you tried doing a clean build with your change?

Yes, I did clean, check-clang-analysis, clean, check-all, clean, check-clang.

If it's urgent, feel free to revert, I won't be near a computer until tomorrow.

If that's the case I'd prefer to revert it to avoid having the build broken for another day.

Could you please take a look at my inline first? Could the fix be that simple? I'm really unsure as to how I could reproduce the error locally.

Also, am I supposed to receive a mail from your buildbots? I unfortunately received none.

We have builders on the silent master but they aren't stable enough yet to promote to the stable master.

Szelethus marked 2 inline comments as done.May 16 2019, 3:32 PM

If there's a cmake variable for fuchsia, Could you please try to add them here? (see inlines) I don't have access to that particular platform.

cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
4 ↗(On Diff #199807)
if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN OR FUCHSIA))
cfe/trunk/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
4 ↗(On Diff #199807)
if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN OR FUCHSIA))
Szelethus marked an inline comment as done.May 16 2019, 3:33 PM
Szelethus added inline comments.
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
4 ↗(On Diff #199807)

(the FUCHSIA is a placeholder here, not sure if we have a variable for it)

phosek added inline comments.May 16 2019, 3:40 PM
cfe/trunk/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
4 ↗(On Diff #199807)

I don't think that's the problem, the build is failing when compiling Clang for Linux, not for Fuchsia.

In that case, feel free to revert this. If around 11:00 CET time I tried to recommit with a possible fix (while watching your bots), would that be an issue?

In that case, feel free to revert this. If around 11:00 CET time I tried to recommit with a possible fix (while watching your bots), would that be an issue?

I managed to reproduce this locally so I'm going to see if there's an easy way to fix this.