Unable to View Results Produced by scan-build

Hello everyone,

I am using scan-view command to view the results generated by scan-build. Yesterday, I was able to navigate through individual files to analyse the warnings raised in them but now it shows the following error.

Error response

Error code 404.

Message: File not found.

Error code explanation: 404 = Nothing matches the given URI.

Can anyone guide me on how to fix this?

Thank you.

Regards,

Malhar Thakkar

​Run scan-build again and don't shut down your computer.​

​Csaba​

Hi Malhar,

scan-build by default writes its output to a temporary folder
why you haven't been able to access the files at a later time.
In order to keep the files and save them to a another path,
you can specify the output location with '-o' (see scan-build
-h for more details).

-Alex

I have an additional query.
After scan-build completes, it says, Run ‘scan-view /Users/malharthakkar/Desktop/scan-build-isl/2017-05-30-161222-546-1’ to examine bug reports.
When I run the above command, it somehow opens the results which I obtained 4 days ago (look at the dates in the browser window and the terminal in the attached screenshot). Any idea why that is happening?
Also, when I ran scan-build along with -o, only a few files were compiled and analyzed, not the entire codebase (How do I build the entire codebase?).

Actually, I am trying to build the ISL codebase with scan-build using the following command.

…/…/GSoC/build/bin/scan-build --use-analyzer /Users/malharthakkar/GSoC/build/bin/clang --use-cc /Users/malharthakkar/GSoC/build/bin/clang -o /Users/malharthakkar/Desktop/scan-build-isl/ -enable-checker osx.cocoa.RetainCount make CC=“gcc” CFLAGS=‘-Wno-nullability-completeness -I/usr/local/include -D__isl_give=“attribute((cf_returns_retained))” -D__isl_take=“attribute((cf_consumed))”’

Thank you.

Regards,
Malhar Thakkar

Did you clean the built project before running scan-build again? Since scan-build interposes on calls to the compiler, if the build system doesn’t build a source file then scan-build won’t see it. This is a common pitfall — we should really mention this in the documentation for scan-build!

Also, don’t forget to run any ./configure script through scan-build as well so you don’t get hard-wired paths to the wrong compiler. <https://clang-analyzer.llvm.org/scan-build.html#recommended_autoconf>

Devin

Thank you Dr. Devin. That really helped clarify my query regarding scan-build.
But, I still don’t understand why scan-view shows older results even after specifying the correct directory.

Like mentioned in my previous email, scan-view /Users/malharthakkar/Desktop/scan-build-isl/2017-05-30-161222-546-1 opens a directory which was created on 26th of May when it should’ve opened the one created today (i.e., 30th of May).

Thank you.

Regards,
Malhar

This seems mysterious and i couldn't immediately reproduce it. Could you check that the port you're connecting to with your browser (eg. http://127.0.0.1:8181) matches the port scan-view dumps on the command line (eg.

   $ scan-view /tmp/scan-build-2017-05-31-155455-89354-1
   Starting scan-view at: http://127.0.0.1:8181
     Use Ctrl-C to exit.

)?

If nothing helps, i'd probably suggest, as a workaround, that you can open index.html from the results directory directly into your browser and it'd be the same thing just without an intermediate web server running on your machine.

31/05/2017 4:15 PM, Malhar Thakkar wrote:

    This seems mysterious and i couldn't immediately reproduce it.
    Could you check that the port you're connecting to with your
    browser (eg. http://127.0.0.1:8181) matches the port scan-view
    dumps on the command line (eg.

      $ scan-view /tmp/scan-build-2017-05-31-155455-89354-1
      Starting scan-view at: http://127.0.0.1:8181
        Use Ctrl-C to exit.

    )?

It is evident from the screenshot that I sent in one of my previous emails that both the ports (seen in the browser and the command line) are the same.

Whoops, sorry! Didn't pay attention.