Bug 388925 - Segmentation fault in OldStyleConnect::fixits() calling Expr::getBestDynamicClassType()
Summary: Segmentation fault in OldStyleConnect::fixits() calling Expr::getBestDynamicC...
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-13 19:52 UTC by Tom Isaacson
Modified: 2018-09-23 14:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Isaacson 2018-01-13 19:52:26 UTC
I'm running clazy-standalone on my codebase and it keeps crashing. The stack showed me it was crashing while calling Expr::getBestDynamicClassType() from OldStyleConnect::fixits() and I was able to confirm this by adding debug output.

I'm wondering if this is https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg16745.html so I tried recompiling clazy with clang 6.0 but I'm having trouble. I've built the clang source myself but there doesn't seem to be a way to override FindClang.cmake with my build directory rather than Ubuntu's default clang 3.8 install. Do I have to edit the cmake build myself?
Comment 1 Sergio Martins 2018-01-13 20:01:26 UTC
So it doesn't crash if you disable fixits ? Fixits should be disabled by default already though, unless you enabled them.

Can you share the backtrace ?
Comment 2 Tom Isaacson 2018-01-13 20:42:15 UTC
No. I've turned them on - my command line is:
export CLAZY_FIXIT=fix-old-style-connect && find . -name "*cpp" -print | xargs /usr/bin/clazy-standalone -extra-arg=-Wno-unknown-warning-option -extra-arg=-fms-extensions -extra-arg=-Wno-inconsistent-missing-override -p build/compile_commands.json -checks=old-style-connect

Stacktrace:
 #0  0x00007f7fcac23240 in getInterestingTagDecl(clang::TagDecl*) () from /home/tom/Documents/clazy/lib/ClangLazy.so
 No symbol table info available.
 #1  0x00007f7fca448685 in OldStyleConnect::fixits (this=0x52543f0, classification=12, call=0x7c322d0) at /home/big/Documents/BitBucket/clazy/src/checks/level2/oldstyleconnect.cpp:450
         expr = 0x7c31200
         record = 0x0
         s = {ID = 4125}
         lastRecordDecl = 0x26d2298
         arg = 0x7c31200
         __for_range = <unknown type in /home/tom/Documents/clazy/lib/ClangLazy.so, CU 0xd17f00b, DIE 0xd4817fc>
         __for_begin = {<llvm::iterator_adaptor_base<clang::Stmt::ExprIterator, clang::Stmt**, std::random_access_iterator_tag, clang::Expr*, long, clang::Expr**, clang::Expr*&, std::iterator_traits<clang::Stmt**> >> = {<llvm::iterator_facade_base<clang::Stmt::ExprIterator, std::random_access_iterator_tag, clang::Expr*, long, clang::Expr**, clang::Expr*&>> = {<std::iterator<std::random_access_iterator_tag, clang::Expr*, long, clang::Expr**, clang::Expr*&>> = {<No data fields>}, <No data fields>}, I = 0x7c322f8}, <No data fields>}
         __for_end = {<llvm::iterator_adaptor_base<clang::Stmt::ExprIterator, clang::Stmt**, std::random_access_iterator_tag, clang::Expr*, long, clang::Expr**, clang::Expr*&, std::iterator_traits<clang::Stmt**> >> = {<llvm::iterator_facade_base<clang::Stmt::ExprIterator, std::random_access_iterator_tag, clang::Expr*, long, clang::Expr**, clang::Expr*&>> = {<std::iterator<std::random_access_iterator_tag, clang::Expr*, long, clang::Expr**, clang::Expr*&>> = {<No data fields>}, <No data fields>}, I = 0x7c32310}, <No data fields>}
         fixits = std::vector of length 0, capacity 0
         macroNum = 0
         implicitCallee = ""
         macroName = ""
         senderMethod = 0x0
 #2  0x00007f7fca446915 in OldStyleConnect::VisitStmt (this=0x52543f0, s=0x7c322d0) at /home/big/Documents/BitBucket/clazy/src/checks/level2/oldstyleconnect.cpp:215
         call = 0x7c322d0
         function = 0x1fd74f0
         classification = 12
 #3  0x00007f7fca471a1e in ClazyASTConsumer::VisitStmt (this=0x39662f0, stm=0x7c322d0) at /home/big/Documents/BitBucket/clazy/src/Clazy.cpp:139
         check = 0x52543f0
         __for_range = std::vector of length 1, capacity 1 = {0x52543f0}
         __for_begin = 
         __for_end = 
         parentMap = 0x78c61f0
         isFromIgnorableInclude = false
 #4  0x00007f7fca4d603a in clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromStmt (this=0x39662f0, S=0x7c322d0) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:320
 No locals.
 #5  0x00007f7fca4d61f2 in clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromExpr (this=0x39662f0, S=0x7c322d0) at /usr/lib/llvm-3.8/include/clang/AST/StmtNodes.inc:115
 No locals.
 #6  0x00007f7fca4cf228 in clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromCallExpr (this=0x39662f0, S=0x7c322d0) at /usr/lib/llvm-3.8/include/clang/AST/StmtNodes.inc:311
 No locals.
 #7  0x00007f7fca4ba581 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseCallExpr (this=0x39662f0, S=0x7c322d0, Queue=0x7ffd5832cc90) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:2195
 No locals.
 #8  0x00007f7fca4a6f41 in clang::RecursiveASTVisitor<ClazyASTConsumer>::dataTraverseNode (this=0x39662f0, S=0x7c322d0, Queue=0x7ffd5832cc90) at /usr/lib/llvm-3.8/include/clang/AST/StmtNodes.inc:311
 No locals.
 #9  0x00007f7fca491be0 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseStmt (this=0x39662f0, S=0x7c323a8, Queue=0x0) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:560
         CurrS = 0x7c322d0
         N = 0
         LocalQueue = {<llvm::SmallVectorImpl<clang::Stmt*>> = {<llvm::SmallVectorTemplateBase<clang::Stmt*, true>> = {<llvm::SmallVectorTemplateCommon<clang::Stmt*, void>> = {<llvm::SmallVectorBase> = {BeginX = 0x7ffd5832cca8, EndX = 0x7ffd5832cca8, CapacityX = 0x7ffd5832cce8}, FirstEl = {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\320\"\303\a\000\000\000"}, <No data fields>}}, <No data fields>}, <No data fields>}, Storage = {InlineElts = {{<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\360\366\302\a\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\031#\263\312\177\177\000"}, <No data fields>}, {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\000\000\000\000\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "{J\262\312\177\177\000"}, <No data fields>}, {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\350\365\302\a\000\000\000"}, <No data fields>}, {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\300\315\062X\375\177\000"}, <No data fields>}, {<llvm::AlignedCharArray<8ul, 8ul>> = {buffer = "\220 \261\003\000\000\000"}, <No data fields>}}}}
 #10 0x00007f7fca494f92 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseFunctionHelper (this=0x39662f0, D=0x7c2f600) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1795
 No locals.
 #11 0x00007f7fca48ac81 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseCXXMethodDecl (this=0x39662f0, D=0x7c2f600) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1806
 No locals.
 #12 0x00007f7fca4838c2 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseDecl (this=0x39662f0, D=0x7c2f600) at /usr/lib/llvm-3.8/include/clang/AST/DeclNodes.inc:367
 No locals.
 #13 0x00007f7fca490e7e in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseDeclContextHelper (this=0x39662f0, DC=0x67b7750) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1231
         Child = 0x7c2f600
         __for_range = <unknown type in /home/tom/Documents/clazy/lib/ClangLazy.so, CU 0xd7d1600, DIE 0xdb5423c>
         __for_begin = {Current = 0x7c2f600}
         __for_end = {Current = 0x0}
 #14 0x00007f7fca48ba4f in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseTranslationUnitDecl (this=0x39662f0, D=0x67b7730) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1321
 No locals.
 #15 0x00007f7fca483c25 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseDecl (this=0x39662f0, D=0x67b7730) at /usr/lib/llvm-3.8/include/clang/AST/DeclNodes.inc:491
 No locals.
 #16 0x00007f7fca471ab7 in ClazyASTConsumer::HandleTranslationUnit (this=0x39662f0, ctx=...) at /home/big/Documents/BitBucket/clazy/src/Clazy.cpp:151
 No locals.
 #17 0x00007f7fcac7476a in clang::ParseAST(clang::Sema&, bool, bool) () from /home/tom/Documents/clazy/lib/ClangLazy.so
 No symbol table info available.
 #18 0x00007f7fca52fcce in clang::FrontendAction::Execute() () from /home/tom/Documents/clazy/lib/ClangLazy.so
 No symbol table info available.
 #19 0x00007f7fca552656 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) () from /home/tom/Documents/clazy/lib/ClangLazy.so
 No symbol table info available.
 #20 0x00000000004e3916 in clang::tooling::FrontendActionFactory::runInvocation(clang::CompilerInvocation*, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) ()
 No symbol table info available.
 #21 0x00000000004dee10 in clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, clang::CompilerInvocation*, std::shared_ptr<clang::PCHContainerOperations>) ()
 No symbol table info available.
 #22 0x00000000004e17b9 in clang::tooling::ToolInvocation::run() ()
 No symbol table info available.
 #23 0x00000000004e27c5 in clang::tooling::ClangTool::run(clang::tooling::ToolAction*) ()
 No symbol table info available.
 #24 0x00000000004ae1c7 in main (argc=41, argv=0x7ffd5832e048) at /home/big/Documents/BitBucket/clazy/src/ClazyStandaloneMain.cpp:103
         optionsParser = {static HelpMessage = 0x55f438 "\n-p <build-path> is used to read a compile command database.\n\n\tFor example, it can be a CMake build directory in which a file named\n\tcompile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=O"..., Compilations = std::unique_ptr<clang::tooling::CompilationDatabase> containing 0xcdb810, SourcePathList = std::vector of length 34, capacity 34 = {"./DataTransferManager/tGetPredictWindRouteHandles.cpp", "./DataTransferManager/tReportDeviceData.cpp", "./DataTransferManager/tGetSoftwareUpdates.cpp", "./DataTransferManager/PredictWind/tPredictWind.cpp", "./DataTransferManager/PredictWind/tPredictWindRouteImporter.cpp", "./DataTransferManager/tDataTransferManager.cpp", "./DataTransferManager/tUploadFtp.cpp", "./DataTransferManager/tTransfer.cpp", "./DataTransferManager/tDownload.cpp", "./DataTransferManager/tGetMapIndex.cpp", "./DataTransferManager/UpdatesManager/tUpdateController.cpp", "./DataTransferManager/UpdatesManager/tUpdatesManager.cpp", "./DataTransferManager/UpdatesManager/tUpdateStatus.cpp", "./DataTransferManager/tGetCustomerDetails.cpp", "./DataTransferManager/tDownloadFTP.cpp", "./DataTransferManager/tOJDeviceOtherData.cpp", "./DataTransferManager/tOJSetProductStatus.cpp", "./DataTransferManager/tDownloadHTTPPredictWind.cpp", "./DataTransferManager/tUncompress.cpp", "./DataTransferManager/tOJGetProducts.cpp", "./DataTransferManager/tGetWebData.cpp", "./DataTransferManager/tTransferManager.cpp", "./DataTransferManager/tCompress.cpp", "./DataTransferManager/tReportCrashData.cpp", "./DataTransferManager/tOJSoftwareUrl.cpp", "./DataTransferManager/tDataTransferManagerSettings.cpp", "./DataTransferManager/tLibs3.cpp", "./DataTransferManager/tDownloadHTTP.cpp", "./DataTransferManager/tSessionID.cpp", "./DataTransferManager/Test/TestDataTransferManager.cpp", "./DataTransferManager/Test/TestCompress.cpp", "./DataTransferManager/tUploadAWS.cpp", "./DataTransferManager/tUploadSl2.cpp", "./DataTransferManager/tTransferGroup.cpp"}, ExtraArgsBefore = std::vector of length 0, capacity 0, ExtraArgsAfter = std::vector of length 0, capacity 0}
         tool = {Compilations = @0xcdb810, SourcePaths = std::vector of length 34, capacity 34 = {"./DataTransferManager/tGetPredictWindRouteHandles.cpp", "./DataTransferManager/tReportDeviceData.cpp", "./DataTransferManager/tGetSoftwareUpdates.cpp", "./DataTransferManager/PredictWind/tPredictWind.cpp", "./DataTransferManager/PredictWind/tPredictWindRouteImporter.cpp", "./DataTransferManager/tDataTransferManager.cpp", "./DataTransferManager/tUploadFtp.cpp", "./DataTransferManager/tTransfer.cpp", "./DataTransferManager/tDownload.cpp", "./DataTransferManager/tGetMapIndex.cpp", "./DataTransferManager/UpdatesManager/tUpdateController.cpp", "./DataTransferManager/UpdatesManager/tUpdatesManager.cpp", "./DataTransferManager/UpdatesManager/tUpdateStatus.cpp", "./DataTransferManager/tGetCustomerDetails.cpp", "./DataTransferManager/tDownloadFTP.cpp", "./DataTransferManager/tOJDeviceOtherData.cpp", "./DataTransferManager/tOJSetProductStatus.cpp", "./DataTransferManager/tDownloadHTTPPredictWind.cpp", "./DataTransferManager/tUncompress.cpp", "./DataTransferManager/tOJGetProducts.cpp", "./DataTransferManager/tGetWebData.cpp", "./DataTransferManager/tTransferManager.cpp", "./DataTransferManager/tCompress.cpp", "./DataTransferManager/tReportCrashData.cpp", "./DataTransferManager/tOJSoftwareUrl.cpp", "./DataTransferManager/tDataTransferManagerSettings.cpp", "./DataTransferManager/tLibs3.cpp", "./DataTransferManager/tDownloadHTTP.cpp", "./DataTransferManager/tSessionID.cpp", "./DataTransferManager/Test/TestDataTransferManager.cpp", "./DataTransferManager/Test/TestCompress.cpp", "./DataTransferManager/tUploadAWS.cpp", "./DataTransferManager/tUploadSl2.cpp", "./DataTransferManager/tTransferGroup.cpp"}, PCHContainerOps = std::shared_ptr (count 5, weak 0) 0x1376040, OverlayFileSystem = {Obj = 0x13779d0}, InMemoryFileSystem = {Obj = 0x1377a10}, Files = {Obj = 0x1377b10}, MappedFileContents = std::vector of length 0, capacity 0, SeenWorkingDirectories = {<llvm::StringMap<char, llvm::MallocAllocator>> = {<llvm::StringMapImpl> = {TheTable = 0x1376270, NumBuckets = 16, NumItems = 2, NumTombstones = 0, ItemSize = 8}, Allocator = {<llvm::AllocatorBase<llvm::MallocAllocator>> = {<No data fields>}, <No data fields>}}, <No data fields>}, ArgsAdjuster = {<std::_Maybe_unary_or_binary_function<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> > > >, 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> > > > const&, llvm::StringRef>> = {<std::binary_function<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> > > > const&, llvm::StringRef, 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> > > > >> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x13784f0, _M_const_object = 0x13784f0, _M_function_pointer = 0x13784f0, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x13784f0, this adjustment 20413616}, _M_pod_data = "\360\204\067\001\000\000\000\000\260|7\001\000\000\000"}, _M_manager = 0x4e3a80 <std::_Function_base::_Base_manager<clang::tooling::combineAdjusters(std::function<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> > > > (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> > > > const&, llvm::StringRef)>, std::function<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> > > > (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> > > > const&, llvm::StringRef)>)::{lambda(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> > > > const&, llvm::StringRef)#1}>::_M_manager(std::_Any_data&, std::_Function_base::_Base_manager<clang::tooling::combineAdjusters(std::function<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> > > > (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> > > > const&, llvm::StringRef)>, std::function<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> > > > (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> > > > const&, llvm::StringRef)>)::{lambda(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> > > > const&, llvm::StringRef)#1}> const&, std::_Manager_operation)>}, _M_invoker = 0x4e3dd0 <std::_Function_handler<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> > > > (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> > > > const&, llvm::StringRef), clang::tooling::combineAdjusters(std::function<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> > > > (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> > > > const&, llvm::StringRef)>, std::function<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> > > > (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> > > > const&, llvm::StringRef)>)::{lambda(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> > > > const&, llvm::StringRef)#1}>::_M_invoke(std::_Any_data const&, 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> > > > const&, llvm::StringRef&&)>}, DiagConsumer = 0x0}
StacktraceAddressSignature: /usr/bin/clazy-standalone:11:/home/big/Documents/clazy/lib/ClangLazy.so+ebf240:/home/big/Documents/clazy/lib/ClangLazy.so+6e4685:/home/big/Documents/clazy/lib/ClangLazy.so+6e2915:/home/big/Documents/clazy/lib/ClangLazy.so+70da1e:/home/big/Documents/clazy/lib/ClangLazy.so+77203a:/home/big/Documents/clazy/lib/ClangLazy.so+7721f2:/home/big/Documents/clazy/lib/ClangLazy.so+76b228:/home/big/Documents/clazy/lib/ClangLazy.so+756581:/home/big/Documents/clazy/lib/ClangLazy.so+742f41:/home/big/Documents/clazy/lib/ClangLazy.so+72dbe0:/home/big/Documents/clazy/lib/ClangLazy.so+730f92:/home/big/Documents/clazy/lib/ClangLazy.so+726c81:/home/big/Documents/clazy/lib/ClangLazy.so+71f8c2:/home/big/Documents/clazy/lib/ClangLazy.so+72ce7e:/home/big/Documents/clazy/lib/ClangLazy.so+727a4f
StacktraceTop:
 getInterestingTagDecl(clang::TagDecl*) () from /home/tom/Documents/clazy/lib/ClangLazy.so
 OldStyleConnect::fixits (this=0x52543f0, classification=12, call=0x7c322d0) at /home/big/Documents/BitBucket/clazy/src/checks/level2/oldstyleconnect.cpp:450
 OldStyleConnect::VisitStmt (this=0x52543f0, s=0x7c322d0) at /home/big/Documents/BitBucket/clazy/src/checks/level2/oldstyleconnect.cpp:215
 ClazyASTConsumer::VisitStmt (this=0x39662f0, stm=0x7c322d0) at /home/big/Documents/BitBucket/clazy/src/Clazy.cpp:139
 clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromStmt (this=0x39662f0, S=0x7c322d0) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:320
Comment 3 Tom Isaacson 2018-01-13 21:02:11 UTC
I can open the .crash file using apport-retrace:
(gdb) bt
#0  0x00007fe406a22240 in getInterestingTagDecl(clang::TagDecl*) () from /home/tom/Documents/clazy/lib/ClangLazy.so
#1  0x00007fe406247685 in OldStyleConnect::fixits (this=0x643fea0, classification=12, call=0x7f30000) at /home/big/Documents/BitBucket/clazy/src/checks/level2/oldstyleconnect.cpp:450
#2  0x00007fe406245915 in OldStyleConnect::VisitStmt (this=0x643fea0, s=0x7f30000) at /home/big/Documents/BitBucket/clazy/src/checks/level2/oldstyleconnect.cpp:215
#3  0x00007fe406270a1e in ClazyASTConsumer::VisitStmt (this=0x43b1380, stm=0x7f30000) at /home/big/Documents/BitBucket/clazy/src/Clazy.cpp:139
#4  0x00007fe4062d503a in clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromStmt (this=0x43b1380, S=0x7f30000) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:320
#5  0x00007fe4062d51f2 in clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromExpr (this=0x43b1380, S=0x7f30000) at /usr/lib/llvm-3.8/include/clang/AST/StmtNodes.inc:115
#6  0x00007fe4062ce228 in clang::RecursiveASTVisitor<ClazyASTConsumer>::WalkUpFromCallExpr (this=0x43b1380, S=0x7f30000) at /usr/lib/llvm-3.8/include/clang/AST/StmtNodes.inc:311
#7  0x00007fe4062b9581 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseCallExpr (this=0x43b1380, S=0x7f30000, Queue=0x7ffeb1a1e430)
    at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:2195
#8  0x00007fe4062a5f41 in clang::RecursiveASTVisitor<ClazyASTConsumer>::dataTraverseNode (this=0x43b1380, S=0x7f30000, Queue=0x7ffeb1a1e430) at /usr/lib/llvm-3.8/include/clang/AST/StmtNodes.inc:311
#9  0x00007fe406290be0 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseStmt (this=0x43b1380, S=0x7f300d8, Queue=0x0) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:560
#10 0x00007fe406293f92 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseFunctionHelper (this=0x43b1380, D=0x7f2d330) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1795
#11 0x00007fe406289c81 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseCXXMethodDecl (this=0x43b1380, D=0x7f2d330) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1806
#12 0x00007fe4062828c2 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseDecl (this=0x43b1380, D=0x7f2d330) at /usr/lib/llvm-3.8/include/clang/AST/DeclNodes.inc:367
#13 0x00007fe40628fe7e in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseDeclContextHelper (this=0x43b1380, DC=0x4366d00) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1231
#14 0x00007fe40628aa4f in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseTranslationUnitDecl (this=0x43b1380, D=0x4366ce0) at /usr/lib/llvm-3.8/include/clang/AST/RecursiveASTVisitor.h:1321
#15 0x00007fe406282c25 in clang::RecursiveASTVisitor<ClazyASTConsumer>::TraverseDecl (this=0x43b1380, D=0x4366ce0) at /usr/lib/llvm-3.8/include/clang/AST/DeclNodes.inc:491
#16 0x00007fe406270ab7 in ClazyASTConsumer::HandleTranslationUnit (this=0x43b1380, ctx=...) at /home/big/Documents/BitBucket/clazy/src/Clazy.cpp:151
#17 0x00007fe406a7376a in clang::ParseAST(clang::Sema&, bool, bool) () from /home/tom/Documents/clazy/lib/ClangLazy.so
#18 0x00007fe40632ecce in clang::FrontendAction::Execute() () from /home/tom/Documents/clazy/lib/ClangLazy.so
#19 0x00007fe406351656 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) () from /home/tom/Documents/clazy/lib/ClangLazy.so
#20 0x00000000004e3916 in clang::tooling::FrontendActionFactory::runInvocation(clang::CompilerInvocation*, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*)
    ()
#21 0x00000000004dee10 in clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, clang::CompilerInvocation*, std::shared_ptr<clang::PCHContainerOperations>) ()
#22 0x00000000004e17b9 in clang::tooling::ToolInvocation::run() ()
#23 0x00000000004e27c5 in clang::tooling::ClangTool::run(clang::tooling::ToolAction*) ()
#24 0x00000000004ae1c7 in main (argc=41, argv=0x7ffeb1a1f7e8) at /home/big/Documents/BitBucket/clazy/src/ClazyStandaloneMain.cpp:103
Comment 4 Sergio Martins 2018-01-14 22:47:05 UTC
weird, I don't have a line 450 in oldstyleconnect.cpp, which commit is this ?
Comment 5 Tom Isaacson 2018-01-14 22:54:01 UTC
I've made some small changes but nothing to do with this crash - line 450 is:
    const auto record = expr ? expr->getBestDynamicClassType() : nullptr;
Comment 6 Tom Isaacson 2018-01-18 19:26:24 UTC
Have you had any success in building with Clang 6.0? I can't figure out how to override CMake from using Clang 3.8.
Comment 7 Sergio Martins 2018-03-24 12:08:13 UTC
Yes, clang 6.0 works fine too.
Could you attach the .cpp file that made it crash ? Or trim it down to the essential part
Comment 8 Sergio Martins 2018-09-23 14:12:47 UTC
Git commit 5b3a3464a2e0315dc452cc8574c4945afe2d8bf3 by Sergio Martins.
Committed on 23/09/2018 at 14:11.
Pushed by smartins into branch '1.4'.

Fix crash in old-style-connect fixits

M  +22   -1    src/checks/level2/old-style-connect.cpp

https://commits.kde.org/clazy/5b3a3464a2e0315dc452cc8574c4945afe2d8bf3