[llvm-bugs] [Bug 37354] New: segmentation fault (clang::Stmt::getSourceRange() const llvm/tools/clang/lib/AST/Stmt.cpp:267:0)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 7 08:47:39 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37354

            Bug ID: 37354
           Summary: segmentation fault (clang::Stmt::getSourceRange()
                    const llvm/tools/clang/lib/AST/Stmt.cpp:267:0)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vegard.nossum at gmail.com
                CC: llvm-bugs at lists.llvm.org

Input:

struct {
  int Ir;
  char &&a;
} y[] {
  0
}

Output:

$ clang++ -x c++ -c -
Stack dump:
0.      Program arguments: /home/vegard/llvm-build/bin/clang-7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name -
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/vegard/creduce/-.gcno -resource-dir
/home/vegard/llvm-build/lib/clang/7.0.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++ -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/backward
-internal-isystem /usr/local/include -internal-isystem
/home/vegard/llvm-build/lib/clang/7.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/vegard/creduce -ferror-limit 19 -fmessage-length
180 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o -.o -x c++ - 
1.      <eof> parser at end of file
#0 0x0000000008da8742 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/vegard/llvm/lib/Support/Unix/Signals.inc:403:0
#1 0x0000000008d9e6f2 llvm::sys::RunSignalHandlers()
/home/vegard/llvm/lib/Support/Signals.cpp:50:0
#2 0x0000000008d9eea9 SignalHandler(int)
/home/vegard/llvm/lib/Support/Unix/Signals.inc:243:0
#3 0x00007f3c182b7390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000011c5feb0 clang::Stmt::getSourceRange() const
/home/vegard/llvm/tools/clang/lib/AST/Stmt.cpp:267:0
#5 0x000000001029f80d (anonymous
namespace)::InitListChecker::FillInEmptyInitForField(unsigned int,
clang::FieldDecl*, clang::InitializedEntity const&, clang::InitListExpr*,
bool&, bool) (.constprop.793)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:589:0
#6 0x00000000102a29f1 (anonymous
namespace)::InitListChecker::FillInEmptyInitializations(clang::InitializedEntity
const&, clang::InitListExpr*, bool&, clang::InitListExpr*, unsigned int, bool)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:709:0
#7 0x00000000102a1b5f (anonymous
namespace)::InitListChecker::FillInEmptyInitializations(clang::InitializedEntity
const&, clang::InitListExpr*, bool&, clang::InitListExpr*, unsigned int, bool)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:809:0
#8 0x00000000102a390c (anonymous
namespace)::InitListChecker::InitListChecker(clang::Sema&,
clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool,
bool) (.constprop.792)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:833:0
#9 0x00000000102ac25d diagnoseListInit(clang::Sema&, clang::InitializedEntity
const&, clang::InitListExpr*) (.constprop.799)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:7561:0
#10 0x00000000102ad02f clang::InitializationSequence::Diagnose(clang::Sema&,
clang::InitializedEntity const&, clang::InitializationKind const&,
llvm::ArrayRef<clang::Expr*>)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:7965:0
#11 0x00000000102b1d62 clang::InitializationSequence::Perform(clang::Sema&,
clang::InitializedEntity const&, clang::InitializationKind const&,
llvm::MutableArrayRef<clang::Expr*>, clang::QualType*)
/home/vegard/llvm/tools/clang/lib/Sema/SemaInit.cpp:6577:0
#12 0x000000000f8c494f clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool) /home/vegard/llvm/tools/clang/lib/Sema/SemaDecl.cpp:10745:0
#13 0x000000000ea2009a
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:2367:0
#14 0x000000000ea578c4 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:2045:0
#15 0x000000000e9cc22e
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1012:0
#16 0x000000000e9cdd91
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.168.constprop.192)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1028:0
#17 0x000000000e9cded7
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1030:0
#18 0x000000000e9dff74
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:853:0
#19 0x000000000e9e3529 _ZN5clang13AttributePoolD4Ev
/home/vegard/llvm/tools/clang/include/clang/Sema/AttributeList.h:642:0
#20 0x000000000e9e3529 _ZN5clang16ParsedAttributesD4Ev
/home/vegard/llvm/tools/clang/include/clang/Sema/AttributeList.h:755:0
#21 0x000000000e9e3529 _ZN5clang6Parser25ParsedAttributesWithRangeD4Ev
/home/vegard/llvm/tools/clang/include/clang/Parse/Parser.h:1308:0
#22 0x000000000e9e3529
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:606:0
#23 0x000000000e9e4e78
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:536:0
#24 0x000000000e9baa78 clang::ParseAST(clang::Sema&, bool, bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#25 0x000000000c01df2c clang::CodeGenAction::ExecuteAction()
/home/vegard/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1044:0
#26 0x000000000aecb7d6 clang::FrontendAction::Execute()
/home/vegard/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:904:0
#27 0x000000000ad5d2c8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/vegard/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:990:0
#28 0x000000000b2dc498
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/vegard/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:256:0
#29 0x0000000000e993f8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/vegard/llvm/tools/clang/tools/driver/cc1_main.cpp:222:0
#30 0x0000000000de2539 ExecuteCC1Tool
/home/vegard/llvm/tools/clang/tools/driver/driver.cpp:310:0
#31 0x0000000000de2539 main
/home/vegard/llvm/tools/clang/tools/driver/driver.cpp:382:0
#32 0x00007f3c1700d830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#33 0x0000000000e7e1f9 _start (/home/vegard/llvm-build/bin/clang-7+0xe7e1f9)
clang-7: error: unable to execute command: Segmentation fault
clang-7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (https://github.com/llvm-mirror/clang
fd84b47426fa82c78ca25ba20cf37fc9b0f42586) (https://github.com/llvm-mirror/llvm
e1b4442d3ffc378f4a48dd0bfeb2b0876b116e2f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/vegard/llvm-build/bin

-- 
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/20180507/1e76fed7/attachment.html>


More information about the llvm-bugs mailing list