<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - crash: scan-build clang llvm/tools/clang/test/Analysis/unix-fns.c with clang r183237"
   href="http://llvm.org/bugs/show_bug.cgi?id=16227">16227</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash: scan-build clang llvm/tools/clang/test/Analysis/unix-fns.c with clang r183237
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>michael.mccracken@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>With clang r183237 and llvm r183239, this command:

% cd /Users/mmccrack/Documents/analysis/build/tools
% ../../llvm/tools/clang/tools/scan-build/scan-build -V
--use-analyzer=/Users/mmccrack/Documents/analysis/build/Debug+Asserts/bin/clang
/Users/mmccrack/Documents/analysis/build/Debug+Asserts/bin/clang -cc1 -analyze
-fblocks -analyzer-checker=core,unix.API,osx.API
/Users/mmccrack/Documents/analysis/llvm/tools/clang/test/Analysis/unix-fns.c


produces the following crash report, showing up in the terminal after the
analysis results: 

Assertion failed: (isValid()), function getExpansionLoc, file
/Users/mmccrack/Documents/analysis/llvm/tools/clang/lib/Basic/SourceLocation.cpp,
line 86.
0  clang             0x0000000110c32bbe llvm::sys::PrintStackTrace(__sFILE*) +
46
1  clang             0x0000000110c32ecb _ZL28PrintStackTraceSignalHandlerPv +
27
2  clang             0x0000000110c331d9 _ZL13SignalHandleri + 297
3  libsystem_c.dylib 0x00007fff83208cfa _sigtramp + 26
4  libsystem_c.dylib 0x000004007a88049d _sigtramp + 4150753213
5  clang             0x0000000110c32efb raise + 27
6  clang             0x0000000110c32fb2 abort + 18
7  clang             0x0000000110c32f91 __assert_rtn + 129
8  clang             0x000000010f7a0d52 clang::FullSourceLoc::getExpansionLoc()
const + 82
9  clang             0x000000010ee76c25
clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(clang::ento::PathDiagnostic*)
+ 549
10 clang             0x000000010edbfea4
clang::ento::BugReporter::FlushReport(clang::ento::BugReport*,
clang::ento::PathDiagnosticConsumer&, llvm::ArrayRef<clang::ento::BugReport*>)
+ 1492
11 clang             0x000000010edb8165
clang::ento::BugReporter::FlushReport(clang::ento::BugReportEquivClass&) + 325
12 clang             0x000000010edb7ef0
clang::ento::BugReporter::FlushReports() + 512
13 clang             0x000000010ebf2662 (anonymous
namespace)::AnalysisConsumer::ActionExprEngine(clang::Decl*, bool,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*) + 642
14 clang             0x000000010ebf2378 (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks(clang::Decl*,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*) + 136
15 clang             0x000000010ebf1c95 (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*) + 533
16 clang             0x000000010ebf18f3 (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int) + 643
17 clang             0x000000010ebf08e7 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) + 535
18 clang             0x000000010e6046c9 clang::ParseAST(clang::Sema&, bool,
bool) + 777
19 clang             0x000000010e2244e8
clang::ASTFrontendAction::ExecuteAction() + 312
20 clang             0x000000010e22405a clang::FrontendAction::Execute() + 186
21 clang             0x000000010e1e1c52
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 866
22 clang             0x000000010e154574
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1028
23 clang             0x000000010e140619 cc1_main(char const**, char const**,
char const*, void*) + 697
24 clang             0x000000010e14ce9d main + 477
25 clang             0x000000010e140334 start + 52
26 clang             0x000000000000003c start + 4058774844
Stack dump:
0.    Program arguments:
/Users/mmccrack/Documents/analysis/build/Debug+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.7.0 -analyze -disable-free -main-file-name unix-fns.c
-analyzer-store=region -analyzer-opt-analyze-nested-blocks
-analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=unix
-analyzer-checker=osx -analyzer-checker=deadcode
-analyzer-checker=security.insecureAPI.UncheckedReturn
-analyzer-checker=security.insecureAPI.getpw
-analyzer-checker=security.insecureAPI.gets
-analyzer-checker=security.insecureAPI.mktemp
-analyzer-checker=security.insecureAPI.mkstemp
-analyzer-checker=security.insecureAPI.vfork -analyzer-output plist -w
-mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -target-linker-version 128.2 -resource-dir
/Users/mmccrack/Documents/analysis/build/Debug+Asserts/bin/../lib/clang/3.4
-fdebug-compilation-dir /Users/mmccrack/Documents/analysis/build/tools
-ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.7.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fdiagnostics-show-option -backend-option -vectorize-loops
-analyzer-output=html -o
/var/folders/sn/knffnnd96s9c237ktkb4llxm0000gn/T/scan-build-2013-06-04-2 -x c
/Users/mmccrack/Documents/analysis/llvm/tools/clang/test/Analysis/unix-fns.c 
1.    <eof> parser at end of file
scan-build: 0 bugs found.
scan-build: The analyzer encountered problems on some source files.
scan-build: Preprocessed versions of these sources were deposited in
'/var/folders/sn/knffnnd96s9c237ktkb4llxm0000gn/T/scan-build-2013-06-04-2/failures'.
scan-build: Please consider submitting a bug report using these files:
scan-build:   <a href="http://clang-analyzer.llvm.org/filing_bugs.html">http://clang-analyzer.llvm.org/filing_bugs.html</a>
scan-build: Analysis run complete.
scan-build: Viewing analysis results in
'/var/folders/sn/knffnnd96s9c237ktkb4llxm0000gn/T/scan-build-2013-06-04-2'
using scan-view.
Can't exec "scan-view": No such file or directory at
../../llvm/tools/clang/tools/scan-build/scan-build line 1668.


Note that just invoking clang like this:
/Users/mmccrack/Documents/analysis/build/Debug+Asserts/bin/clang -cc1 -analyze
-fblocks -analyzer-checker=core,unix.API,osx.API
/Users/mmccrack/Documents/analysis/llvm/tools/clang/test/Analysis/unix-fns.c

works as expected.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>