LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 3725 - Incorrect path for scan-view in scan-build
Summary: Incorrect path for scan-view in scan-build
Status: CONFIRMED
Alias: None
Product: clang
Classification: Unclassified
Component: Static Analyzer (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Ted Kremenek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-04 13:34 PST by Vladimir G. Ivanovic
Modified: 2010-02-22 12:46 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir G. Ivanovic 2009-03-04 13:34:23 PST
Here's the error message I get when running 'scan-build make' on the latest (21.5-b28) XEmacs sources:

...
make[1]: Leaving directory `/usr/local/src/xemacs/man'
scan-build: 257 bugs found.
scan-build: Run 'scan-view /tmp/scan-build-2009-03-03-1' to examine bug reports.
scan-build: Analysis run complete.
scan-build: Viewing analysis results in '/tmp/scan-build-2009-03-03-1' using scan-view.
Can't exec "scan-view": No such file or directory at /usr/local/src/llvm/tools/clang/utils/scan-build line 1223.

Here's the fix I used (note: scan-view is not installed by 'make install'):

$ cd /usr/local/src/llvm
$ svn di tools/clang/utils/scan-build 
Index: tools/clang/utils/scan-build
===================================================================
--- tools/clang/utils/scan-build	(revision 65935)
+++ tools/clang/utils/scan-build	(working copy)
@@ -1218,7 +1218,7 @@
   if ($ViewResults and -r "$HtmlDir/index.html") {
     Diag "Analysis run complete.\n";
     Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n";
-    my $ScanView = Cwd::realpath("$RealBin/scan-view");
+    my $ScanView = Cwd::realpath("$RealBin/scan-view/scan-view");
     if (! -x $ScanView) { $ScanView = "scan-view"; }
     exec $ScanView, "$HtmlDir";
   }
Comment 1 Ted Kremenek 2009-03-04 14:50:08 PST
(In reply to comment #0)

> ===================================================================
> --- tools/clang/utils/scan-build        (revision 65935)
> +++ tools/clang/utils/scan-build        (working copy)
> @@ -1218,7 +1218,7 @@
>    if ($ViewResults and -r "$HtmlDir/index.html") {
>      Diag "Analysis run complete.\n";
>      Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n";
> -    my $ScanView = Cwd::realpath("$RealBin/scan-view");
> +    my $ScanView = Cwd::realpath("$RealBin/scan-view/scan-view");
>      if (! -x $ScanView) { $ScanView = "scan-view"; }
>      exec $ScanView, "$HtmlDir";
>    }
> 

In the checker builds 'scan-view' is put in the same directory as 'scan-build', hence the current logic works.  On my system 'scan-view' is also in my path, so I hadn't noticed this issue.

I'm not certain why doing "$RealBin/scan-view/scan-view" should work, since 'scan-view' is in the 'tools' directory and 'scan-build' in the 'utils' directory (that can easily be changed of course by moving 'scan-build' to 'tools').  $RealBin is suppose to be the directory where 'scan-build' resides.