[llvm-bugs] [Bug 28646] New: "clang: error: unable to execute command: Segmentation fault (core dumped)" when parsing unbalanced curly braces

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 21 12:08:12 PDT 2016


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

            Bug ID: 28646
           Summary: "clang: error: unable to execute command: Segmentation
                    fault (core dumped)" when parsing unbalanced curly
                    braces
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dholbert at mozilla.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16782
  --> https://llvm.org/bugs/attachment.cgi?id=16782&action=edit
terminal output with a bit more context (from the start of my incremental
build, up to the "PLEASE submit a bug report")

I just tried to compile some source code with (accidentally) unbalanced curly
braces, and I got the following resulting output. Filing a bug, as directed by
the error message in my terminal output.

TERMINAL OUTPUT:
================
 0:08.81 fatal error: too many errors emitted, stopping now [-ferror-limit=]
 0:08.81 0  libLLVM-3.8.so.1 0x00007fb999a6fd38
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56
 0:08.81 1  libLLVM-3.8.so.1 0x00007fb999a6dfc6 llvm::sys::RunSignalHandlers()
+ 54
 0:08.81 2  libLLVM-3.8.so.1 0x00007fb999a6e129
 0:08.81 3  libc.so.6        0x00007fb998bab4a0
 0:08.81 4  clang            0x00000000007c1565
 0:08.81 5  clang            0x0000000000ddd99e
 0:08.81 6  clang            0x0000000000dde171
clang::Sema::AttachBaseSpecifiers(clang::CXXRecordDecl*,
llvm::MutableArrayRef<clang::CXXBaseSpecifier*>) + 1729
 0:08.81 7  clang            0x0000000000dde6b6
clang::Sema::ActOnBaseSpecifiers(clang::Decl*,
llvm::MutableArrayRef<clang::CXXBaseSpecifier*>) + 70
 0:08.81 8  clang            0x0000000000b6dd42
clang::Parser::ParseBaseClause(clang::Decl*) + 242
 0:08.81 9  clang            0x0000000000b72ecb
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 1803
 0:08.81 10 clang            0x0000000000b74161
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 3393
 0:08.81 11 clang            0x0000000000b553ca
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 5834
 0:08.81 12 clang            0x0000000000b6fe9d
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 1293
 0:08.81 13 clang            0x0000000000b72515
clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&,
clang::Parser::ParsedAttributesWithRange&, clang::TypeSpecifierType,
clang::Decl*) + 741
 0:08.81 14 clang            0x0000000000b72bf7
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 1079
 0:08.81 15 clang            0x0000000000b74161
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 3393
 0:08.81 16 clang            0x0000000000b553ca
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 5834
 0:08.81 17 clang            0x0000000000b5f82c
clang::Parser::ParseSimpleDeclaration(unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*)
+ 700
 0:08.81 18 clang            0x0000000000b5fb76
clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 214
 0:08.82 19 clang            0x0000000000bb636f
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&) + 3183
 0:08.82 20 clang            0x0000000000bb658a
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*) + 138
 0:08.82 21 clang            0x0000000000bba759
clang::Parser::ParseCompoundStatementBody(bool) + 1769
 0:08.82 22 clang            0x0000000000bbd31a
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 314
 0:08.82 23 clang            0x0000000000b3e0d8
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
1240
 0:08.82 24 clang            0x0000000000bc7980
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 3968
 0:08.82 25 clang            0x0000000000bc8571
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1057
 0:08.82 26 clang            0x0000000000bc888f
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 111
 0:08.82 27 clang            0x0000000000b5fce7
clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 583
 0:08.82 28 clang            0x0000000000b409f1
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 321
 0:08.82 29 clang            0x0000000000b413dc
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 460
 0:08.82 30 clang            0x0000000000b3662b clang::ParseAST(clang::Sema&,
bool, bool) + 619
 0:08.82 31 clang            0x000000000099a1fe
clang::FrontendAction::Execute() + 302
 0:08.82 32 clang            0x000000000096fbf6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 278
 0:08.82 33 clang            0x0000000000a14aa3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1987
 0:08.82 34 clang            0x00000000006b2d18 cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 2264
 0:08.82 35 clang            0x00000000006af7ac main + 6252
 0:08.82 36 libc.so.6        0x00007fb998b96830 __libc_start_main + 240
 0:08.82 37 clang            0x00000000006b1159 _start + 41
 0:08.82 Stack dump:
 0:08.82 0.    Program arguments: /usr/lib/llvm-3.8/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-main-file-name Unified_cpp_image1.cpp -mrelocation-model pic -pic-level 2
-mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -coverage-file
/scratch/work/builds/mozilla-inbound/obj/image/Unified_cpp_image1.o
-resource-dir /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0 -include
../../mozilla/config/gcc_hidden.h -include ../mozilla-config.h -I
../dist/stl_wrappers -I ../config/system_wrappers -D DEBUG=1 -D TRACING=1 -D
OS_POSIX=1 -D OS_LINUX=1 -D STATIC_EXPORTABLE_JS_API -D MOZILLA_INTERNAL_API -D
IMPL_LIBXUL -I ../../mozilla/image -I . -I ../ipc/ipdl/_ipdlheaders -I
../../mozilla/ipc/chromium/src -I ../../mozilla/ipc/glue -I
../../mozilla/dom/base -I ../../mozilla/dom/svg -I ../../mozilla/gfx/2d -I
../../mozilla/image/decoders -I ../../mozilla/layout/svg -I
../../mozilla/netwerk/base -I ../../mozilla/xpcom/threads -I
../../mozilla/gfx/skia -I ../../mozilla/gfx/skia/skia/include/config -I
../../mozilla/gfx/skia/skia/include/core -I
../../mozilla/gfx/skia/skia/include/gpu -I
../../mozilla/gfx/skia/skia/include/utils -I ../dist/include -I
../dist/include/nspr -I ../dist/include/nss -D MOZILLA_CLIENT -I
../dist/include/cairo -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -Wc++11-compat -Wempty-body
-Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare
-Wtype-limits -Wunreachable-code -Wwrite-strings -Wc++11-compat-pedantic
-Wc++14-compat -Wc++14-compat-pedantic -Wc++1z-compat -Wclass-varargs
-Wimplicit-fallthrough -Wloop-analysis -Werror=non-literal-null-conversion
-Wstring-conversion -Wthread-safety -Wno-invalid-offsetof
-Wno-inline-new-delete -Wno-error=deprecated-declarations
-Wno-error=array-bounds -Wno-unknown-warning-option -Wno-return-type-c-linkage
-Werror -Wno-error=shadow -std=gnu++11 -fdeprecated-macro
-fdebug-compilation-dir /scratch/work/builds/mozilla-inbound/obj/image
-ferror-limit 19 -fmessage-length 0 -pthread -fno-rtti -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o Unified_cpp_image1.o -x c++
Unified_cpp_image1.cpp
 0:08.83 1.    ../../mozilla/dom/base/nsDocument.h:568:3: current parser token
'{'
 0:08.83 2.    ../../mozilla/dom/svg/nsSVGAttrTearoffTable.h:49:1: parsing
function body 'GetTearoff'
 0:08.83 3.    ../../mozilla/dom/svg/nsSVGAttrTearoffTable.h:49:1: in compound
statement ('{}')
 0:08.83 4.    ../../mozilla/dom/base/nsDocument.h:508:1: parsing
struct/union/class body 'nsExternalResourceMap'
 0:08.83 5.    ../../mozilla/dom/base/nsDocument.h:566:3: parsing
struct/union/class body 'PendingLoad'
 0:08.83 clang: error: unable to execute command: Segmentation fault (core
dumped)
 0:08.83 clang: error: clang frontend command failed due to signal (use -v to
see invocation)
 0:08.83 clang version 3.8.0-2ubuntu3 (tags/RELEASE_380/final)
 0:08.83 Target: x86_64-pc-linux-gnu
 0:08.83 Thread model: posix
 0:08.83 InstalledDir: /usr/bin
 0:08.83 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.
 0:08.83 clang: note: diagnostic msg:
 0:08.83 ********************
 0:08.83 
 0:08.83 PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
 0:08.83 Preprocessed source(s) and associated run script(s) are located at:
 0:08.83 clang: note: diagnostic msg: /tmp/Unified_cpp_image1-0b5871.cpp
 0:08.83 clang: note: diagnostic msg: /tmp/Unified_cpp_image1-0b5871.sh
 0:08.83 clang: note: diagnostic msg:
 0:08.83 
 0:08.83 ********************

-- 
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/20160721/53b20c06/attachment.html>


More information about the llvm-bugs mailing list