[llvm-bugs] [Bug 28561] New: Segmentation fault

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 14 17:50:17 PDT 2016


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

            Bug ID: 28561
           Summary: Segmentation fault
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pipping at exherbo.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This was originally meant as a reduction of bug #28087. Instead of an assertion
failure, I now get a segfault (with 3.8.1). The (invalid!) code:

<<SNIP
template <class K, int ROWS, int COLS> class FieldMatrix;
template <class GridType, class TrialLocalFE, class AnsatzLocalFE, typename T>
class LocalOperatorAssembler {
}
template <class GridType, class TrialLocalFE, class AnsatzLocalFE,
          class Contraction, class MB = Dune::FieldMatrix<double, 1, 1>,
class SecondOrderOperatorAssembler
    : public LocalOperatorAssembler<GridType, TrialLocalFE, AnsatzLocalFE, MB>
{
  SecondOrderOperatorAssembler(const Contraction &contraction, bool
isSymmetric,
                               FunctionTypes... functions)
      : contraction_(contraction), isSymmetric_(isSymmetric),
        coefficientQuadKey_(coefficientQuadKey), functions_(functions...) {
  }
    double const nu = 0.23;
<<SNAP

and the output:

secondorderassemblertest-57319f.ii:4:2: error: expected ';' after class
}
 ^
 ;
secondorderassemblertest-57319f.ii:6:41: error: use of undeclared identifier
'Dune'
          class Contraction, class MB = Dune::FieldMatrix<double, 1, 1>,
                                        ^
secondorderassemblertest-57319f.ii:10:32: error: unknown type name
'FunctionTypes'
                               FunctionTypes... functions)
                               ^
secondorderassemblertest-57319f.ii:10:45: error: type 'int' of function
parameter pack does not contain any unexpanded parameter packs
                               FunctionTypes... functions)
                               ~~~~~~~~~~~~~^~~~~~~~~~~~~
secondorderassemblertest-57319f.ii:14:28: error: expected '}'
    double const nu = 0.23;
                           ^
secondorderassemblertest-57319f.ii:8:80: note: to match this '{'
    : public LocalOperatorAssembler<GridType, TrialLocalFE, AnsatzLocalFE, MB>
{
                                                                              
^
secondorderassemblertest-57319f.ii:11:9: error: member initializer
'contraction_' does not name a non-static data member or base class
      : contraction_(contraction), isSymmetric_(isSymmetric),
        ^~~~~~~~~~~~~~~~~~~~~~~~~
secondorderassemblertest-57319f.ii:11:36: error: member initializer
'isSymmetric_' does not name a non-static data member or base class
      : contraction_(contraction), isSymmetric_(isSymmetric),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
secondorderassemblertest-57319f.ii:12:29: error: use of undeclared identifier
'coefficientQuadKey'
        coefficientQuadKey_(coefficientQuadKey), functions_(functions...) {
                            ^
#0 0x0000000001c03725 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(PATH/bin/clang-3.8+0x1c03725)
#1 0x0000000001c016e6 llvm::sys::RunSignalHandlers()
(PATH/bin/clang-3.8+0x1c016e6)
#2 0x0000000001c01904 SignalHandler(int) (PATH/bin/clang-3.8+0x1c01904)
#3 0x00007fe9bd4458d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x0000000002fbd1a0 clang::TagType::getDecl() const
(PATH/bin/clang-3.8+0x2fbd1a0)
#5 0x00000000028320c0
clang::Sema::MarkBaseAndMemberDestructorsReferenced(clang::SourceLocation,
clang::CXXRecordDecl*) (PATH/bin/clang-3.8+0x28320c0)
#6 0x0000000002842cba
clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool,
llvm::ArrayRef<clang::CXXCtorInitializer*>) (PATH/bin/clang-3.8+0x2842cba)
#7 0x00000000028438e9 clang::Sema::ActOnMemInitializers(clang::Decl*,
clang::SourceLocation, llvm::ArrayRef<clang::CXXCtorInitializer*>, bool)
(PATH/bin/clang-3.8+0x28438e9)
#8 0x00000000025879dc clang::Parser::ParseConstructorInitializer(clang::Decl*)
(PATH/bin/clang-3.8+0x25879dc)
#9 0x0000000002561b50
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&)
(PATH/bin/clang-3.8+0x2561b50)
#10 0x000000000256171e
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&)
(PATH/bin/clang-3.8+0x256171e)
#11 0x00000000025906a9
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) (PATH/bin/clang-3.8+0x25906a9)
#12 0x0000000002591389
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) (PATH/bin/clang-3.8+0x2591389)
#13 0x0000000002574fb8
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(PATH/bin/clang-3.8+0x2574fb8)
#14 0x00000000025ddf61 clang::Parser::ParseNonTypeTemplateParameter(unsigned
int, unsigned int) (PATH/bin/clang-3.8+0x25ddf61)
#15 0x00000000025e0045 clang::Parser::ParseTemplateParameterList(unsigned int,
llvm::SmallVectorImpl<clang::Decl*>&) (PATH/bin/clang-3.8+0x25e0045)
#16 0x00000000025e022c clang::Parser::ParseTemplateParameters(unsigned int,
llvm::SmallVectorImpl<clang::Decl*>&, clang::SourceLocation&,
clang::SourceLocation&) (PATH/bin/clang-3.8+0x25e022c)
#17 0x00000000025e1ffd
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(PATH/bin/clang-3.8+0x25e1ffd)
#18 0x00000000025e243a
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(PATH/bin/clang-3.8+0x25e243a)
#19 0x000000000257eb74 clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(PATH/bin/clang-3.8+0x257eb74)
#20 0x000000000255ee02
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (PATH/bin/clang-3.8+0x255ee02)
#21 0x000000000255f580
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(PATH/bin/clang-3.8+0x255f580)
#22 0x000000000255764b clang::ParseAST(clang::Sema&, bool, bool)
(PATH/bin/clang-3.8+0x255764b)
#23 0x000000000227204b clang::CodeGenAction::ExecuteAction()
(PATH/bin/clang-3.8+0x227204b)
#24 0x0000000001fd97c6 clang::FrontendAction::Execute()
(PATH/bin/clang-3.8+0x1fd97c6)
#25 0x0000000001fb2eb6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(PATH/bin/clang-3.8+0x1fb2eb6)
#26 0x000000000205fe53
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(PATH/bin/clang-3.8+0x205fe53)
#27 0x0000000000aa40b8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (PATH/bin/clang-3.8+0xaa40b8)
#28 0x0000000000a634a7 main (PATH/bin/clang-3.8+0xa634a7)
#29 0x00007fe9bc66fb45 __libc_start_main
/build/glibc-uPj9cH/glibc-2.19/csu/libc-start.c:321:0
#30 0x0000000000aa02b4 _start (PATH/bin/clang-3.8+0xaa02b4)
Stack dump:
0.    Program arguments: PATH/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
secondorderassemblertest-57319f.ii -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 -resource-dir PATH/bin/../lib/clang/3.8.1 -std=c++14
-fdeprecated-macro -fdebug-compilation-dir /home/mi/pipping -ferror-limit 19
-fmessage-length 181 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/secondorderassemblertest-57319f-d9cdf7.o -x c++-cpp-output
secondorderassemblertest-57319f.ii 
1.    secondorderassemblertest-57319f.ii:12:75: current parser token '{'
2.    secondorderassemblertest-57319f.ii:7:1: parsing struct/union/class body
'SecondOrderOperatorAssembler'
clang-3.8: error: unable to execute command: Segmentation fault
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.1 (tags/RELEASE_381/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: PATH/bin
clang-3.8: 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-3.8: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

-- 
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/20160715/51469b4e/attachment-0001.html>


More information about the llvm-bugs mailing list