WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
68910
Would like an EWS bot that runs the Clang static analyzer on patches
https://bugs.webkit.org/show_bug.cgi?id=68910
Summary
Would like an EWS bot that runs the Clang static analyzer on patches
Adam Roben (:aroben)
Reported
2011-09-27 09:46:42 PDT
It would be great to have an EWS bot that ran patches through the Clang static analyzer. Then we could find issues even before the patch is landed!
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2011-09-27 09:47:12 PDT
<
rdar://problem/10193189
>
Adam Barth
Comment 2
2011-09-27 09:57:51 PDT
How do I run the clang static analyzer?
Adam Roben (:aroben)
Comment 3
2011-09-27 10:12:42 PDT
There are generic instructions on <
http://clang-analyzer.llvm.org/scan-build.html
>. I'm not sure what the specific process would be for WebKit.
Adam Roben (:aroben)
Comment 4
2011-09-27 10:13:22 PDT
See also
bug 68908
.
Adam Barth
Comment 5
2011-09-27 10:41:16 PDT
Thakis is working on switching the webkit.org build of Chromium Mac to use clang, which seems related. (The chromium.org version already uses clang.) I'm pretty ignorant about this topic, but I think that will help here.
Adam Roben (:aroben)
Comment 6
2011-09-28 05:05:17 PDT
I wonder if something as simple as "scan-build build-webkit" would work?
Adam Barth
Comment 7
2011-09-28 09:54:46 PDT
abarth@quadzen:~/svn/webkit$ scan-build build-webkit -bash: scan-build: command not found ^^^ Maybe I need Lion?
Adam Roben (:aroben)
Comment 8
2011-09-28 10:01:33 PDT
I don't seem to have a "scan-build" binary either. I do notice that clang supports an --analyze flag. I guess we should figure out how Xcode drives clang for static analysis.
Adam Roben (:aroben)
Comment 9
2011-09-28 10:03:40 PDT
It looks like Xcode is just calling "clang --analyze" (with loads of other options appropriate for the project, of course).
Anders Carlsson
Comment 10
2011-09-28 10:04:25 PDT
scan-build is just a perl script - it's available from the clang svn repository.
Adam Roben (:aroben)
Comment 11
2011-09-28 10:49:43 PDT
Supposedly this will do it (for a single project, of course): xcodebuild RUN_CLANG_STATIC_ANALYZER=YES
Adam Roben (:aroben)
Comment 12
2012-01-11 07:58:33 PST
See also
bug 68908
.
Nico Weber
Comment 13
2012-01-11 08:09:32 PST
scan-build isn't distributed anywhere I know of, but it can be checked out from the clang svn repo here:
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/
As of 2011-11-30, the analyzer doesn't understand RAII and smart pointers (
http://llvm.org/bugs/show_bug.cgi?id=11425#c1
), which makes it not very useful for c++ projects in my experience. As far as I know, this is still true today.
Mark Rowe (bdash)
Comment 14
2012-01-11 10:43:29 PST
It's distributed as part of Xcode, and is incredibly effective at finding issues in code that makes use of Objective-C and CF. It's effectiveness in C++ code will only increase over time.
Adam Barth
Comment 15
2012-01-11 10:53:43 PST
If it's a Mac thing, then it should be straightforward to run on the mac-ews. Sorry for the ignorant question, but does "xcodebuild RUN_CLANG_STATIC_ANALYZER=YES" generate a compiled binary, or just run the analysis? If the analysis step is separate, we might want to run the analysis on separate bots to avoid slowing down the mac-ews.
Mark Rowe (bdash)
Comment 16
2012-01-11 11:08:22 PST
It both compiles and runs the analysis.
Adam Barth
Comment 17
2012-01-11 11:33:26 PST
Ok. Maybe the thing to do is to add a --analyze flag to build-webkit that runs the analysis together with building. thakis warned me in IRC that the static analysis can be much slower than the normal compile, so we'll want to make sure we have enough machine bandwidth.
Alexey Proskuryakov
Comment 18
2025-01-29 13:16:09 PST
Technically, we have a static analyzer bot now, but with very focused coverage that doesn't fulfill the intention of this bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug