[clazy] [Bug 354540] New: Clazy didn't work, always crashed. What i am doing wrong?

alexey.ivanes at gmail.comviaKDEBugzilla alexey.ivanes at gmail.comviaKDEBugzilla
Thu Oct 29 08:47:51 GMT 2015


https://bugs.kde.org/show_bug.cgi?id=354540

            Bug ID: 354540
           Summary: Clazy didn't work, always crashed. What i am doing
                    wrong?
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: alexey.ivanes at gmail.com

I tested on Ubuntu 15.10 and openSUSE Leap. 

Building on openSUSE fine. On ubuntu with official packages `"unknown symbol
_ZNK5clang15DeclarationName11getAsStringEv".` 

**Tested on ubuntu with prebuild clang from llvm.org:**

    export CC=/opt/clang37/bin/clang
    export CXX=/opt/clang37/bin/clang++
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/clang37 -DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH=/opt/clang37/
    make
    sudo make install

    export CLAZY_CHECKS="all_checks"
    qmake ../vacuum.pro -r INSTALL_PREFIX=/opt/dev_qt5 CONFIG-=release
CONFIG+=debug -spec linux-clang QMAKE_CXXFLAGS+="-std=c++11 -Xclang -load
-Xclang ClangLazy.so -Xclang -add-plugin -Xclang clang-lazy"
QMAKE_CC=/opt/clang37/bin/clang QMAKE_CXX=/opt/clang37/bin/clang++
    make

    /opt/clang37/bin/clang++ -c -pipe -std=c++11 -Xclang -load -Xclang
ClangLazy.so -Xclang -add-plugin -Xclang clang-lazy -O2 -fPIC -w -D_REENTRANT
-DPLUGINS_DIR=\"../lib/vacuum/plugins\"
-DRESOURCES_DIR=\"../share/vacuum/resources\"
-DTRANSLATIONS_DIR=\"../share/vacuum/translations\" -DQT_NO_DEBUG -DQT_GUI_LIB
-DQT_CORE_LIB -I../../../../src/thirdparty/qtlockedfile
-I/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile -isystem
/usr/include/x86_64-linux-gnu/qt5 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtGui -isystem
/usr/include/x86_64-linux-gnu/qt5/QtCore
-I/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile
-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtlockedfile.o
../../../../src/thirdparty/qtlockedfile/qtlockedfile.cpp
    terminate called after throwing an instance of 'std::bad_alloc'
      what():  std::bad_alloc
    0  clang-3.7       0x00000000013e06b8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
    1  clang-3.7       0x00000000013e1a1b
    2  libpthread.so.0 0x00007f09304e9d10
    3  libc.so.6       0x00007f092f8a3267 gsignal + 55
    4  libc.so.6       0x00007f092f8a4eca abort + 362
    5  libstdc++.so.6  0x00007f092fedeb7d
__gnu_cxx::__verbose_terminate_handler() + 365
    6  libstdc++.so.6  0x00007f092fedc9c6
    7  libstdc++.so.6  0x00007f092fedca11
    8  libstdc++.so.6  0x00007f092fedcc29
    9  libstdc++.so.6  0x00007f092fedd1cc
    10 ClangLazy.so    0x00007f092f626043
clang::LangOptions::LangOptions(clang::LangOptions const&) + 163
    11 ClangLazy.so    0x00007f092f62273b
OldStyleConnect::OldStyleConnect(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) + 107
    12 ClangLazy.so    0x00007f092f625d23
    13 ClangLazy.so    0x00007f092f613edf
CheckManager::createCheck(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) + 319
    14 ClangLazy.so    0x00007f092f614e74
CheckManager::createChecks(std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >) + 516
    15 ClangLazy.so    0x00007f092f64c611
    16 clang-3.7       0x000000000173b4ea
clang::FrontendAction::CreateWrappedASTConsumer(clang::CompilerInstance&,
llvm::StringRef) + 330
    17 clang-3.7       0x000000000173c092
clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&,
clang::FrontendInputFile const&) + 2578
    18 clang-3.7       0x000000000170d4c7
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 695
    19 clang-3.7       0x00000000017a9de3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3123
    20 clang-3.7       0x00000000006f6634 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 1156
    21 clang-3.7       0x00000000006f586f main + 11983
    22 libc.so.6       0x00007f092f88ea40 __libc_start_main + 240
    23 clang-3.7       0x00000000006f2893
    Stack dump:
    0.    Program arguments: /opt/clang37/bin/clang-3.7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-main-file-name qtlockedfile.cpp -mrelocation-model pic -pic-level 2
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-dwarf-column-info -coverage-file
/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile/qtlockedfile.o
-resource-dir /opt/clang37/bin/../lib/clang/3.7.0 -isystem
/usr/include/x86_64-linux-gnu/qt5 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtGui -isystem
/usr/include/x86_64-linux-gnu/qt5/QtCore -D _REENTRANT -D
PLUGINS_DIR="../lib/vacuum/plugins" -D
RESOURCES_DIR="../share/vacuum/resources" -D
TRANSLATIONS_DIR="../share/vacuum/translations" -D QT_NO_DEBUG -D QT_GUI_LIB -D
QT_CORE_LIB -I ../../../../src/thirdparty/qtlockedfile -I
/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile -I
/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile -I
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/x86_64-linux-gnu/c++/5.2.1
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/x86_64-linux-gnu/c++/5.2.1
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/clang37/bin/../lib/clang/3.7.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -w -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile
-ferror-limit 19 -fmessage-length 253 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops
-vectorize-slp -load ClangLazy.so -add-plugin clang-lazy -o qtlockedfile.o -x
c++ ../../../../src/thirdparty/qtlockedfile/qtlockedfile.cpp 
    clang-3.7: error: unable to execute command: Aborted (core dumped)
    clang-3.7: error: clang frontend command failed due to signal (use -v to
see invocation)

**And on openSUSE Leap with clang from official repo!**

    clang++ -c -pipe -std=c++11 -Xclang -load -Xclang ClangLazy.so -Xclang
-add-plugin -Xclang clang-lazy -g -fPIC -w -D_REENTRANT -DDEBUG_MODE
-DPLUGINS_DIR=\"./plugins\"
-DRESOURCES_DIR=\"/home/vm/dev/dev_qt5/src/make/../../resources\"
-DTRANSLATIONS_DIR=\"./src/translations\" -DQT_GUI_LIB -DQT_CORE_LIB
-I../../../../src/thirdparty/qtlockedfile
-I/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile -isystem
/usr/include/qt5 -isystem /usr/include/qt5/QtGui -isystem
/usr/include/qt5/QtCore
-I/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile
-I/usr/lib64/qt5/mkspecs/linux-clang -o qtlockedfile.o
../../../../src/thirdparty/qtlockedfile/qtlockedfile.cpp
    terminate called after throwing an instance of 'std::regex_error'
      what():  regex_error
    #0 0x7f9d84d6c638 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/bin/../lib64/libLLVMSupport.so.3.7+0xb8638)
    #1 0x7f9d84d6d86b (/usr/bin/../lib64/libLLVMSupport.so.3.7+0xb986b)
    #2 0x7f9d83072200 __restore_rt (/lib64/libc.so.6+0x35200)
    #3 0x7f9d83072187 __GI_raise (/lib64/libc.so.6+0x35187)
    #4 0x7f9d83073538 __GI_abort (/lib64/libc.so.6+0x36538)
    #5 0x7f9d8347ab8d __gnu_cxx::__verbose_terminate_handler()
(/usr/bin/../lib64/libstdc++.so.6+0x96b8d)
    #6 0x7f9d83478bf6 (/usr/bin/../lib64/libstdc++.so.6+0x94bf6)
    #7 0x7f9d83478c41 (/usr/bin/../lib64/libstdc++.so.6+0x94c41)
    #8 0x7f9d83478e58 (/usr/bin/../lib64/libstdc++.so.6+0x94e58)
    #9 0x7f9d834a0c35
std::__throw_regex_error(std::regex_constants::error_type)
(/usr/bin/../lib64/libstdc++.so.6+0xbcc35)
    #10 0x7f9d7be86e11 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_atom()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2de11)
    #11 0x7f9d7be86ad0 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2dad0)
    #12 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #13 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #14 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #15 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #16 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #17 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #18 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #19 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #20 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #21 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #22 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #23 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #24 0x7f9d7be86b18 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_alternative()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2db18)
    #25 0x7f9d7be85154 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_M_disjunction()
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2c154)
    #26 0x7f9d7be84d75 std::__detail::_Compiler<char const*,
std::regex_traits<char> >::_Compiler(char const* const&, char const* const&,
std::regex_traits<char>&, unsigned int)
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2bd75)
    #27 0x7f9d7be849c3 std::shared_ptr<std::__detail::_Automaton>
std::__detail::__compile<char const*, std::regex_traits<char> >(char const*
const&, char const* const&, std::regex_traits<char>&, unsigned int)
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2b9c3)
    #28 0x7f9d7be842c8 PreprocessorCallbacks::MacroExpands(clang::Token const&,
clang::MacroDefinition const&, clang::SourceRange, clang::MacroArgs const*)
(/usr/bin/../lib64/../lib64/ClangLazy.so+0x2b2c8)
    #29 0x7f9d7efd0765
clang::Preprocessor::HandleMacroExpandedIdentifier(clang::Token&,
clang::MacroDefinition const&)
(/usr/bin/../lib64/../lib64/libclangLex.so.3.7+0x6b765)
    #30 0x7f9d7efea642 clang::Preprocessor::HandleIdentifier(clang::Token&)
(/usr/bin/../lib64/../lib64/libclangLex.so.3.7+0x85642)
    #31 0x7f9d7ef8f81a clang::Lexer::LexIdentifier(clang::Token&, char const*)
(/usr/bin/../lib64/../lib64/libclangLex.so.3.7+0x2a81a)
    #32 0x7f9d7ef96656 clang::Lexer::LexTokenInternal(clang::Token&, bool)
(/usr/bin/../lib64/../lib64/libclangLex.so.3.7+0x31656)
    #33 0x7f9d7efead04 clang::Preprocessor::Lex(clang::Token&)
(/usr/bin/../lib64/../lib64/libclangLex.so.3.7+0x85d04)
    #34 0x7f9d7e251d66
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0x2ed66)
    #35 0x7f9d7e2cb5d5 clang::Parser::ExpectAndConsume(clang::tok::TokenKind,
unsigned int, llvm::StringRef)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0xa85d5)
    #36 0x7f9d7e24ee4b
clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier,
clang::AttributeList*, clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&,
clang::SourceLocation)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0x2be4b)
    #37 0x7f9d7e27b8ca
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0x588ca)
    #38 0x7f9d7e277268
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0x54268)
    #39 0x7f9d7e27549e
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.3.7+0x5249e)
    #40 0x7f9d7e25b313
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0x38313)
    #41 0x7f9d7e2cf0b0
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0xac0b0)
    #42 0x7f9d7e2cedd2
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0xabdd2)
    #43 0x7f9d7e2cdc9d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0xaac9d)
    #44 0x7f9d7e2cd4da
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0xaa4da)
    #45 0x7f9d7e24e356 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/../lib64/../lib64/libclangParse.so.3.7+0x2b356)
    #46 0x7f9d83a07e79 clang::FrontendAction::Execute()
(/usr/bin/../lib64/libclangFrontend.so.3.7+0x9ce79)
    #47 0x7f9d839d3da3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/../lib64/libclangFrontend.so.3.7+0x68da3)
    #48 0x7f9d83769073
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/../lib64/libclangFrontendTool.so.3.7+0x3073)
    #49 0x40f9fe cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/usr/bin/clang-3.7+0x40f9fe)
    #50 0x40eab6 main (/usr/bin/clang-3.7+0x40eab6)
    #51 0x7f9d8305eb05 __libc_start_main (/lib64/libc.so.6+0x21b05)
    #52 0x40bf6a _start (/usr/bin/clang-3.7+0x40bf6a)
    Stack dump:
    0.    Program arguments: /usr/bin/clang-3.7 -cc1 -triple x86_64-suse-linux
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
qtlockedfile.cpp -mrelocation-model pic -pic-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/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile/qtlockedfile.o
-resource-dir /usr/bin/../lib64/clang/3.7.0 -isystem /usr/include/qt5 -isystem
/usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -D _REENTRANT -D
DEBUG_MODE -D PLUGINS_DIR="./plugins" -D
RESOURCES_DIR="/home/vm/dev/dev_qt5/src/make/../../resources" -D
TRANSLATIONS_DIR="./src/translations" -D QT_GUI_LIB -D QT_CORE_LIB -I
../../../../src/thirdparty/qtlockedfile -I
/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile -I
/home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile -I
/usr/lib64/qt5/mkspecs/linux-clang -internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.8/../../../../include/c++/4.8
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.8/../../../../include/c++/4.8/x86_64-suse-linux
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.8/../../../../include/c++/4.8/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib64/clang/3.7.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -w -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/vm/dev/dev_qt5/build/src/thirdparty/qtlockedfile
-ferror-limit 19 -fmessage-length 225 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-load ClangLazy.so -add-plugin clang-lazy -o qtlockedfile.o -x c++
../../../../src/thirdparty/qtlockedfile/qtlockedfile.cpp 
    1.    /usr/include/qt5/QtCore/qobject.h:462:5: current parser token
'Q_PRIVATE_SLOT'
    2.    /usr/include/qt5/QtCore/qobject.h:106:1: parsing struct/union/class
body 'QObject'
    clang-3.7: error: unable to execute command: Aborted
    clang-3.7: error: clang frontend command failed due to signal (use -v to
see invocation)




Reproducible: Always

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Unassigned-bugs mailing list