<div dir="ltr"><div><div>Hi Jack,<br><br></div>your report about the scan-build problem is a good feedback. But not sure how well that piece of code is maintained, or these kind of issues (lost bug reports, redirection problem) will be addressed... I did recommend scan-build-py as an alternative solution. That has not been released yet. As a developer of that tool I would glad to hear feedback about it.<br><br></div><div>To use scan-build-py currently you don't need to compile the project. Just make sure that your `PATH` environment contains the `tools/scan-build-py/bin` directory. (This easiness planed to be changed. ;)) I'm saying it because in your second mail, you compile the Clang/LLVM sources, but you didn't run `make install`.<br><br></div><div>Could also send somehow the output of the these commands?<br><br></div><div>$ env # looking for the CC and CXX variables<br></div><div>$ command -v cc<br></div>$ command -v c++<br><div>$ command -v clang<br></div><div>$ command -v clang++<br></div><div>$ cc -v<br></div><div>$ c++ -v<br></div><div>$ clang -v<br></div><div>$ clang++ -v<br><br></div><div>Regards,<br></div><div>Laszlo<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 20, 2017 at 7:40 AM, Jack Bates <span dir="ltr"><<a href="mailto:n02qn5@nottheoilrig.com" target="_blank">n02qn5@nottheoilrig.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for trying to reproduce my problem! I tried again with scan-build from the Clang source repository. Now I'm getting one bug and one crash. So I'm confident that the analyzer is doing *something*, but I still wonder why I'm not seeing the 22 bugs that you are?<br>
<br>
Am I running the same version of scan-build? Is there something about my environment that could explain the discrepancy? I'm running Debian Linux. Are the versions of any other tools on my system significant to this?<br>
<br>
Here's what I did this time:<br>
<br>
  $ svn co <a href="http://llvm.org/svn/llvm-project/llvm/trunk" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-proje<wbr>ct/llvm/trunk</a> llvm<br>
  $ cd llvm/tools<br>
  $ svn co <a href="http://llvm.org/svn/llvm-project/cfe/trunk" rel="noreferrer" target="_blank">http://llvm.org/svn/llvm-proje<wbr>ct/cfe/trunk</a> clang<br>
  $ cd ../..<br>
  $ mkdir build<br>
  $ cd build<br>
  $ cmake ../llvm<br>
  $ make<br>
  $ cd ..<span class=""><br>
  $ git clone <a href="https://github.com/apache/trafficserver.git" rel="noreferrer" target="_blank">https://github.com/apache/traf<wbr>ficserver.git</a><br>
  $ cd trafficserver<br>
  $ autoreconf -i<br>
  $ ./configure<br></span>
  $ ../build/bin/scan-build -v -v make V=1 2>&1 > ~/Desktop/scan-build<br>
<br>
Here's the output [1] -- again, many lines were printed on the console instead. Here's the crash [2].<br>
<br>
Thanks for the tip about scan-build-py, I haven't tried that yet.<br>
<br>
[1] <a href="http://nottheoilrig.com/scan-build-1484839698" rel="noreferrer" target="_blank">http://nottheoilrig.com/scan-b<wbr>uild-1484839698</a><br>
[2] <a href="http://nottheoilrig.com/failures" rel="noreferrer" target="_blank">http://nottheoilrig.com/failur<wbr>es</a><span class=""><br>
<br>
On 18/01/17 06:30 AM, Laszlo Nagy wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hi Jack,<br>
<br>
was following your recipe to analyze the traffic server. Was using the<br>
scan-build-py and scan-build from Clang source repo. Both was leaving me<br>
a non empty report directory with 22 bug reports.<br>
<br>
<br>
And `scan-build` is designed to run through `configure` too. It does not<br>
have a huge cost to do, so should not be an issue. But this case I<br>
agree, the generated makefiles are respecting the `CC` and `CXX`<br>
variables, therefore the interposition works.<br>
<br>
About the redirection problem. I don't know the answer. But I know a<br>
workaround it. If you use the `intercept-build` and `analyze-build` from<br>
scan-build-py, you can separate the interception phase from the actual<br>
static analyzer runs. And when you run `analyze-build` that can be<br>
redirected without this problem.<br>
<br>
Regards,<br>
Laszlo<br>
<br>
On Wed, Jan 18, 2017 at 9:39 AM, Jack Bates via cfe-dev<br></span><div><div class="h5">
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><wbr>>> wrote:<br>
<br>
    I'm running scan-build on Apache Traffic Server and getting "No bugs<br>
    found.", which isn't what I expect.<br>
<br>
    I ran it as follows:<br>
<br>
      $ git clone <a href="https://github.com/apache/trafficserver.git" rel="noreferrer" target="_blank">https://github.com/apache/traf<wbr>ficserver.git</a><br>
    <<a href="https://github.com/apache/trafficserver.git" rel="noreferrer" target="_blank">https://github.com/apache/tra<wbr>fficserver.git</a>><br>
      $ cd trafficserver<br>
      $ autoreconf -i<br>
      $ ./configure<br>
      $ scan-build -v -v make V=1 2>&1 > ~/Desktop/scan-build<br>
<br>
    Here's the output [1].<br>
<br>
    I didn't run ./configure through scan-build, but I conclude from the<br>
    Make output that the compiler is being correctly interposed upon, so<br>
    I shouldn't need to? The output indicates that the compiler is<br>
    c++-analyzer.<br>
<br>
    The output contains lines like the following, so I conclude that the<br>
    analyzer is working?<br>
<br>
      ANALYZE (Syntax): ../../lib/ts/ink_mutex.h ~x_pthread_mutexattr_t<br>
<br>
    And it contains lines like "1 warning generated.", so I conclude<br>
    that there should be bugs?<br>
<br>
    So my first question is, why are there "No bugs found."?<br>
<br>
    Also, although I redirect both stdout and stderr, the lines I<br>
    mentioned -- "ANALYZE ..." and "1 warning generated." -- are<br>
    nonetheless printed on the console, not [1]. Why is that?<br>
<br>
    Thanks!<br>
<br>
    [1] <a href="http://nottheoilrig.com/scan-build" rel="noreferrer" target="_blank">http://nottheoilrig.com/scan-b<wbr>uild</a><br>
    <<a href="http://nottheoilrig.com/scan-build" rel="noreferrer" target="_blank">http://nottheoilrig.com/scan-<wbr>build</a>><br>
    ______________________________<wbr>_________________<br>
    cfe-dev mailing list<br></div></div>
    <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><wbr>><br>
    <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
    <<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin<wbr>/mailman/listinfo/cfe-dev</a>><br>
<br>
<br>
</blockquote>
</blockquote></div><br></div>