[LLVMbugs] [Bug 18983] New: crash in -Wimplicit-fallthrough

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 26 18:36:43 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18983

            Bug ID: 18983
           Summary: crash in -Wimplicit-fallthrough
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: kremenek at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

A crash was introduced sometime today. This only crashes with
-Wimplicit-fallthrough enabled.

Testcase:

void fatal() __attribute__((noreturn));
int num();
void test() {
  switch (num()) {
  case 1:
    fatal();
  case 2:
    break;
  }
}

$ clang -Wimplicit-fallthrough -std=c++11 a.cc
0  clang           0x00000000034a687b llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x00000000034a6af8
2  clang           0x00000000034a6561
3  libpthread.so.0 0x00007f4341bfacb0
4  clang           0x00000000016f212a
5  clang           0x00000000016f5801
6  clang           0x00000000016f5feb
7  clang           0x00000000016f9baf
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
2579
8  clang           0x000000000125ec78
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 150
9  clang           0x0000000001316066
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 3644
10 clang           0x0000000001315227
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*) + 45
11 clang           0x0000000001223b1c
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 502
12 clang           0x00000000011bb14e
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
3052
13 clang           0x00000000011cc02a
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 538
14 clang           0x00000000011ba289
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 1211
15 clang           0x00000000011ba36e
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 174
16 clang           0x00000000011b9a96
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2770
17 clang           0x00000000011b8f79
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 535
18 clang           0x00000000011b29f8 clang::ParseAST(clang::Sema&, bool, bool)
+ 609
19 clang           0x0000000000d27f00 clang::ASTFrontendAction::ExecuteAction()
+ 322
20 clang           0x0000000000fa064d clang::CodeGenAction::ExecuteAction() +
1221
21 clang           0x0000000000d27a33 clang::FrontendAction::Execute() + 205
22 clang           0x0000000000cfa74c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
23 clang           0x0000000000cc7c30
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1074
24 clang           0x0000000000cb95d9 cc1_main(char const**, char const**, char
const*, void*) + 636
25 clang           0x0000000000cc3724 main + 770
26 libc.so.6       0x00007f4340f1d76d __libc_start_main + 237
27 clang           0x0000000000cb7ca9
Stack dump:
0.      Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
a.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.23.52.20130808 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-Wimplicit-fallthrough -std=c++11 -fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/nlewycky -ferror-limit 19 -fmessage-length 244
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/a-bd3938.o
-x c++ a.cc 
1.      <eof> parser at end of file
2.      a.cc:3:13: parsing function body 'test'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (trunk 202330)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/a-976042.cpp
clang: note: diagnostic msg: /tmp/a-976042.sh
clang: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140227/1fdfc4c5/attachment.html>


More information about the llvm-bugs mailing list