[LLVMbugs] [Bug 23189] New: Crash when compiling C++ (qt + gtest)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 10 08:05:13 PDT 2015


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

            Bug ID: 23189
           Summary: Crash when compiling C++ (qt + gtest)
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: winfried_mb2 at xmsnet.nl
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14183
  --> https://llvm.org/bugs/attachment.cgi?id=14183&action=edit
preprocessed source file and run script that crashed clang++ frontend

When compiling a project that uses Qt and Googles GTest from QtCreator (using
cmake), I suddenly got a Clang crash. The output included a request to file a
bug report, so here it is. I also attach the preprocessed source file and
associated run script as requested.

O.S. is openSuse 13.2. I upgraded the default llvm/clang of OpenSuse 13.2 with
the clang 3.6 packages at
http://download.opensuse.org/repositories/devel:/tools:/compiler/openSUSE_13.2/x86_64/llvm-clang-3.6.0-417.7.x86_64.rpm

version information:

winfried at linux-dobbe:~> /usr/bin/clang++ -v
clang version 3.6.0 (tags/RELEASE_360/final 230777)
Target: x86_64-suse-linux
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/4.8
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/4.9
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.9
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/4.9
Candidate multilib: .;@m64
Selected multilib: .;@m64


command line and backtrace:

[ 90%] Building CXX object
test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/qtftpserver_ut.cpp.o
cd /home/winfried/svn_checkout/qtftp-build-clang-debug/test/unit/qtftpserver &&
/usr/bin/clang++   -DQT_CORE_LIB -DQT_NETWORK_LIB -std=c++14 -g -fPIE
-I/home/winfried/svn_checkout/qtftp-build-clang-debug/test/unit/qtftpserver
-I/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver
-I/home/winfried/install/gmock_170_clang_debug/include
-I/home/winfried/svn_checkout/qtftp/lib/include
-I/home/winfried/svn_checkout/qtftp/lib/src
-I/home/winfried/svn_checkout/qtftp/test/unit/stubs/include -isystem
/home/winfried/install/Qt540/5.4/gcc_64/include -isystem
/home/winfried/install/Qt540/5.4/gcc_64/include/QtNetwork
-I/home/winfried/install/Qt540/5.4/gcc_64/include/QtCore
-I/home/winfried/install/Qt540/5.4/gcc_64/mkspecs/linux-g++    -o
CMakeFiles/qtftpserver_ut.dir/qtftpserver_ut.cpp.o -c
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp
#0 0x7f6e53874f18 llvm::sys::PrintStackTrace(_IO_FILE*)
(/usr/bin/../lib64/libLLVMSupport.so+0xa2f18)
#1 0x7f6e538763ab (/usr/bin/../lib64/libLLVMSupport.so+0xa43ab)
#2 0x7f6e520be200 __restore_rt (/lib64/libc.so.6+0x35200)
#3 0x7f6e4f110bee
clang::Sema::DeduceFunctionTypeFromReturnExpr(clang::FunctionDecl*,
clang::SourceLocation, clang::Expr*&, clang::AutoType*)
(/usr/bin/../lib64/../lib64/libclangSema.so+0x35abee)
#4 0x7f6e4f1101c6 clang::Sema::ActOnCapScopeReturnStmt(clang::SourceLocation,
clang::Expr*) (/usr/bin/../lib64/../lib64/libclangSema.so+0x35a1c6)
#5 0x7f6e4f1117a9 clang::Sema::ActOnReturnStmt(clang::SourceLocation,
clang::Expr*, clang::Scope*)
(/usr/bin/../lib64/../lib64/libclangSema.so+0x35b7a9)
#6 0x7f6e4f4caed0 clang::Parser::ParseReturnStatement()
(/usr/bin/../lib64/../lib64/libclangParse.so+0x91ed0)
#7 0x7f6e4f4c6e9f
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x8de9f)
#8 0x7f6e4f4c61cf
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x8d1cf)
#9 0x7f6e4f4cc38f clang::Parser::ParseCompoundStatementBody(bool)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x9338f)
#10 0x7f6e4f4a524b
clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x6c24b)
#11 0x7f6e4f4a36d0 clang::Parser::ParseLambdaExpression()
(/usr/bin/../lib64/../lib64/libclangParse.so+0x6a6d0)
#12 0x7f6e4f497b62 clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x5eb62)
#13 0x7f6e4f493652
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x5a652)
#14 0x7f6e4f474a1c
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x3ba1c)
#15 0x7f6e4f472749 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x39749)
#16 0x7f6e4f46ec97 clang::Parser::ParseSimpleDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x35c97)
#17 0x7f6e4f46e91d clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x3591d)
#18 0x7f6e4f4c6cff
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x8dcff)
#19 0x7f6e4f4c61cf
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x8d1cf)
#20 0x7f6e4f4cc38f clang::Parser::ParseCompoundStatementBody(bool)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x9338f)
#21 0x7f6e4f4ccb26 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x93b26)
#22 0x7f6e4f465e9c
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x2ce9c)
#23 0x7f6e4f46525a
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x2c25a)
#24 0x7f6e4f48b54e
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) (/usr/bin/../lib64/../lib64/libclangParse.so+0x5254e)
#25 0x7f6e4f4890a5 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x500a5)
#26 0x7f6e4f46f254 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x36254)
#27 0x7f6e4f4dd9a0
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/bin/../lib64/../lib64/libclangParse.so+0xa49a0)
#28 0x7f6e4f4dd740
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/bin/../lib64/../lib64/libclangParse.so+0xa4740)
#29 0x7f6e4f4dcceb
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/bin/../lib64/../lib64/libclangParse.so+0xa3ceb)
#30 0x7f6e4f48374a
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::ParsedAttributes&, clang::BalancedDelimiterTracker&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x4a74a)
#31 0x7f6e4f482dbd clang::Parser::ParseNamespace(unsigned int,
clang::SourceLocation&, clang::SourceLocation)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x49dbd)
#32 0x7f6e4f46e749 clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x35749)
#33 0x7f6e4f4dc7ff
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/bin/../lib64/../lib64/libclangParse.so+0xa37ff)
#34 0x7f6e4f4dc1a8
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/bin/../lib64/../lib64/libclangParse.so+0xa31a8)
#35 0x7f6e4f462886 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/../lib64/../lib64/libclangParse.so+0x29886)
#36 0x7f6e529d7169 clang::FrontendAction::Execute()
(/usr/bin/../lib64/libclangFrontend.so+0x93169)
#37 0x7f6e529ab563
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/../lib64/libclangFrontend.so+0x67563)
#38 0x7f6e52741e82 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/../lib64/libclangFrontendTool.so+0x2e82)
#39 0x40c806 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/usr/bin/clang-3.6+0x40c806)
#40 0x40bc21 main (/usr/bin/clang-3.6+0x40bc21)
#41 0x7f6e520aab05 __libc_start_main (/lib64/libc.so.6+0x21b05)
#42 0x40910c _start (/usr/bin/clang-3.6+0x40910c)
Stack dump:
0.    Program arguments: /usr/bin/clang-3.6 -cc1 -triple x86_64-suse-linux
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
qtftpserver_ut.cpp -mrelocation-model pic -pic-level 2 -pie-level 2
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -g
-dwarf-column-info -coverage-file
/home/winfried/svn_checkout/qtftp-build-clang-debug/test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/qtftpserver_ut.cpp.o
-resource-dir /usr/bin/../lib64/clang/3.6.0 -isystem
/home/winfried/install/Qt540/5.4/gcc_64/include -isystem
/home/winfried/install/Qt540/5.4/gcc_64/include/QtNetwork -D QT_CORE_LIB -D
QT_NETWORK_LIB -I
/home/winfried/svn_checkout/qtftp-build-clang-debug/test/unit/qtftpserver -I
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver -I
/home/winfried/install/gmock_170_clang_debug/include -I
/home/winfried/svn_checkout/qtftp/lib/include -I
/home/winfried/svn_checkout/qtftp/lib/src -I
/home/winfried/svn_checkout/qtftp/test/unit/stubs/include -I
/home/winfried/install/Qt540/5.4/gcc_64/include/QtCore -I
/home/winfried/install/Qt540/5.4/gcc_64/mkspecs/linux-g++ -internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/x86_64-suse-linux
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib64/clang/3.6.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++14 -fdeprecated-macro
-fdebug-compilation-dir
/home/winfried/svn_checkout/qtftp-build-clang-debug/test/unit/qtftpserver
-ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -o
CMakeFiles/qtftpserver_ut.dir/qtftpserver_ut.cpp.o -x c++
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp 
1.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:40:107:
current parser token ';'
2.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:8:1:
parsing namespace 'QTFTP'
3.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:12:1:
parsing struct/union/class body 'TestTftpServer'
4.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:32:9:
parsing function body 'getNetworkStreamBySource'
5.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:32:9:
in compound statement ('{}')
6.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:33:37:
lambda expression parsing
7.   
/home/winfried/svn_checkout/qtftp/test/unit/qtftpserver/qtftpserver_ut.cpp:34:13:
in compound statement ('{}')
clang-3.6: error: unable to execute command: Segmentation fault
clang-3.6: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 (tags/RELEASE_360/final 230777)
Target: x86_64-suse-linux
Thread model: posix
clang-3.6: 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.6: note: diagnostic msg: 
********************

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

********************
make[2]: ***
[test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/qtftpserver_ut.cpp.o]
Error 254
make[1]: *** [test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/all] Error 2
test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/build.make:54: recipe for
target
'test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/qtftpserver_ut.cpp.o'
failed
make[2]: Leaving directory
'/home/winfried/svn_checkout/qtftp-build-clang-debug'
CMakeFiles/Makefile2:307: recipe for target
'test/unit/qtftpserver/CMakeFiles/qtftpserver_ut.dir/all' failed
make[1]: Leaving directory
'/home/winfried/svn_checkout/qtftp-build-clang-debug'
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

-- 
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/20150410/280777de/attachment.html>


More information about the llvm-bugs mailing list