clangd icon indicating copy to clipboard operation
clangd copied to clipboard

clangd Segmentation fault in StaticAccessedThroughInstanceCheck

Open dennisoberg opened this issue 3 years ago • 5 comments

Indexing TomHandler.cpp crashes clangd. The issue can be reproduced with the command below. Can this be resolved ? Is there a workaround ?

emwobde@seroiuts01512 ~/ml66/radiolink (master)$ clangd --log=verbose --check=mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp I[12:33:29.529] clangd version 14.0.0 I[12:33:29.529] Features: linux I[12:33:29.529] PID: 24221 I[12:33:29.530] Working directory: /home/emwobde/ml66/radiolink I[12:33:29.530] argv[0]: clangd I[12:33:29.530] argv[1]: --log=verbose I[12:33:29.530] argv[2]: --check=mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp V[12:33:29.530] User config file is /home/emwobde/.config/clangd/config.yaml I[12:33:29.530] Entering check mode (no LSP server) I[12:33:29.530] Testing on source file /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp V[12:33:29.530] config note at /workspace/git/emwobde/ml66_nps/.clangd:1:0: Parsing config fragment V[12:33:29.530] config note at /workspace/git/emwobde/ml66_nps/.clangd:1:0: Parsed 1 fragments from file V[12:33:29.530] Config fragment: compiling /workspace/git/emwobde/ml66_nps/.clangd:1 -> 0x0000000003E68080 (trusted=false) I[12:33:29.530] Loading compilation database... I[12:33:29.544] Loaded compilation database from /workspace/git/emwobde/ml66_nps/radiolink/compile_commands.json V[12:33:29.544] Broadcasting compilation database from /workspace/git/emwobde/ml66_nps/radiolink I[12:33:29.545] Compile command from CDB is: /proj/ml_build/proj-mwn-platform-delivery-generic-local/sdk/release/puma1_mmu_dev/2.393/sysroots/x86_64-montavistasdk-linux/usr/bin/arm-montavista-linux-gnueabi/arm-montavista-linux-gnueabi-g++ --target=arm-montavista-linux-gnueabi --driver-mode=g++ --sysroot=/workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/sdk/sysroots/puma1-montavista-linux "-DACTIVE_NETWORK_RELEASE_FILE_PATH=""" "-DCOMMANDLINE_FILE_PATH=""" "-DCONFIG_PATH="/lib/firmware/bin/"" "-DDM_PATH=""" -DDSP_TYPE "-DHWDB_PATH=""" "-DHWDB_RF1_PATH=""" "-DHWDB_RF2_PATH=""" "-DMEMORY_DEVICES_DEFINITIONS="MemoryDevices_mmu1002.h"" "-DPASSIVE_NETWORK_RELEASE_FILE_PATH=""" -DRauHandler_EXPORTS -DSUPPORT_WEAK_EHSL -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/include -I/workspace/git/emwobde/ml66_nps/build/internal/puma1_mmu_dev/include -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/trace/include -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/AcmHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/AlarmHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Control/Interfaces -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/Interfaces -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/cereal/include -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/GCL/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/common/include -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/ApplicationFramework/public -I/workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/ff_bin -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/Interfaces -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/FrequencyHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Control/OutputPowerController/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/OutputPowerHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Control/SystemPowerController/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/HardwareConfigurationHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RccHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/MessageHandler/public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/mmushared/types/include -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/general_classes/include -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/general_classes/./include -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/trace/src -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/socket/src/../include -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/common/src/../include -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/DspApi/common/./include -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/ApplicationFramework/private/../public -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/Interfaces/internal -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/bsp/src/mmu/. -I/workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Device/DeviceManager/public -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/bsp/src -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/drivers -I/workspace/git/emwobde/ml66_nps/radiolink/os_extensions/ddevio/cppsrc -march=armv6 -mfpu=vfp -mfloat-abi=softfp -mcpu=arm1136jf-s -std=gnu++11 -fPIC -Wall -Wextra -Werror -Wno-write-strings -Wsign-compare -Wformat -Wno-unused-parameter -Wno-psabi -pthread -fasynchronous-unwind-tables -D_GNU_SOURCE -Wl,-O1 -Wl,--hash-style=gnu -rdynamic -DMWN_PROD_FAMILY_MMU -DMWN_TARGET_ARCH=arm -DMWN_TARGET_NAME_MMU1002 -DMWN_TARGET_TYPE_DEV -DMMU1002=MMU1002 -DML -DMWN_RL_MODE_RL5 -DTARGET -g -O3 -fPIC -o CMakeFiles/RauHandler.dir/TomHandler.cpp.o -c --include-directory=/workspace/git/emwobde/ml66_nps/build/sub_products/t1024_npu_dev/sdk/sysroots/t1024rdb-montavista-linux/usr/include/c++/7.3.0 --include-directory=/workspace/git/emwobde/ml66_nps/build/sub_products/t1024_npu_dev/sdk/sysroots/t1024rdb-montavista-linux/usr/include/c++/7.3.0/powerpc-montavista-linux -resource-dir=/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/lib/clang/14.0.0 -- /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp I[12:33:29.545] Giving up on broadcasting CDB, as we're shutting down I[12:33:29.546] Parsing command... V[12:33:29.548] Ignored diagnostic. -Wl,-O1: 'linker' input unused V[12:33:29.548] Ignored diagnostic. -Wl,--hash-style=gnu: 'linker' input unused V[12:33:29.549] Ignored diagnostic. argument unused during compilation: '-rdynamic' I[12:33:29.549] internal (cc1) args are: -cc1 -triple armv6-montavista-linux-gnueabi -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name TomHandler.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu arm1136jf-s -Wunaligned-access -target-feature +soft-float-abi -target-feature -crc -target-feature -dotprod -target-feature +dsp -target-feature -mve -target-feature -mve.fp -target-feature -ras -target-feature -bf16 -target-feature -sb -target-feature -i8mm -target-feature -lob -target-feature -cdecp0 -target-feature -cdecp1 -target-feature -cdecp2 -target-feature -cdecp3 -target-feature -cdecp4 -target-feature -cdecp5 -target-feature -cdecp6 -target-feature -cdecp7 -target-feature -pacbti -target-feature -hwdiv-arm -target-feature -hwdiv -target-feature +vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature -vfp3d16sp -target-feature -vfp3sp -target-feature -fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature -vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature +fp64 -target-feature -d32 -target-feature -neon -target-feature -fp16fml -target-feature -crypto -target-feature -sha2 -target-feature -aes -target-feature +strict-align -target-abi aapcs-linux -mfloat-abi soft -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -fcoverage-compilation-dir=/workspace/git/emwobde/ml66_nps/build/internal/puma1_mmu_dev/mars/cte/src/PlatformServices/RauHandler/private -resource-dir /afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/lib/clang/14.0.0 -D "ACTIVE_NETWORK_RELEASE_FILE_PATH=""" -D "COMMANDLINE_FILE_PATH=""" -D "CONFIG_PATH="/lib/firmware/bin/"" -D "DM_PATH=""" -D DSP_TYPE -D "HWDB_PATH=""" -D "HWDB_RF1_PATH=""" -D "HWDB_RF2_PATH=""" -D "MEMORY_DEVICES_DEFINITIONS="MemoryDevices_mmu1002.h"" -D "PASSIVE_NETWORK_RELEASE_FILE_PATH=""" -D RauHandler_EXPORTS -D SUPPORT_WEAK_EHSL -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/include -I /workspace/git/emwobde/ml66_nps/build/internal/puma1_mmu_dev/include -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/trace/include -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/AcmHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/AlarmHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Control/Interfaces -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/Interfaces -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/cereal/include -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/GCL/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/common/include -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/ApplicationFramework/public -I /workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/ff_bin -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/Interfaces -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/FrequencyHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Control/OutputPowerController/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/OutputPowerHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Control/SystemPowerController/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/HardwareConfigurationHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RccHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/MessageHandler/public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/mmushared/types/include -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/general_classes/include -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/general_classes/./include -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/trace/src -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/socket/src/../include -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/common/src/../include -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/DspApi/common/./include -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/ApplicationFramework/private/../public -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Framework/Interfaces/internal -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/bsp/src/mmu/. -I /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/Device/DeviceManager/public -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/bsp/src -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/drivers -I /workspace/git/emwobde/ml66_nps/radiolink/os_extensions/ddevio/cppsrc -D _GNU_SOURCE -D MWN_PROD_FAMILY_MMU -D MWN_TARGET_ARCH=arm -D MWN_TARGET_NAME_MMU1002 -D MWN_TARGET_TYPE_DEV -D MMU1002=MMU1002 -D ML -D MWN_RL_MODE_RL5 -D TARGET -I /workspace/git/emwobde/ml66_nps/build/sub_products/t1024_npu_dev/sdk/sysroots/t1024rdb-montavista-linux/usr/include/c++/7.3.0 -I /workspace/git/emwobde/ml66_nps/build/sub_products/t1024_npu_dev/sdk/sysroots/t1024rdb-montavista-linux/usr/include/c++/7.3.0/powerpc-montavista-linux -isysroot /workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/sdk/sysroots/puma1-montavista-linux -internal-isystem /afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/lib/clang/14.0.0/include -internal-isystem /workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/sdk/sysroots/puma1-montavista-linux/usr/local/include -internal-externc-isystem /workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/sdk/sysroots/puma1-montavista-linux/include -internal-externc-isystem /workspace/git/emwobde/ml66_nps/build/sub_products/puma1_mmu_dev/sdk/sysroots/puma1-montavista-linux/usr/include -O3 -Wall -Wextra -Werror -Wno-write-strings -Wsign-compare -Wformat -Wno-unused-parameter -Wno-psabi -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir=/workspace/git/emwobde/ml66_nps/build/internal/puma1_mmu_dev/mars/cte/src/PlatformServices/RauHandler/private -ferror-limit 19 -pthread -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp I[12:33:29.549] Building preamble... I[12:33:30.331] Indexing headers... V[12:33:30.463] indexed preamble AST for /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp version null: symbol slab: 14377 symbols, 4306890 bytes ref slab: 0 symbols, 0 refs, 128 bytes relations slab: 669 relations, 17432 bytes V[12:33:30.572] Build dynamic index for header symbols with estimated memory usage of 9320182 bytes V[12:33:30.580] Built preamble of size 12914292 for file /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/private/TomHandler.cpp version null I[12:33:30.581] Building AST... V[12:33:30.881] Dropped diagnostic: /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/public/TomHandler.h: use default member initializer for 'm_rauRestartedListener' [modernize-use-default-member-init] V[12:33:30.881] Dropped diagnostic: /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/public/TomHandler.h: use default member initializer for 'm_tomRauCompensationParametersEventListener' [modernize-use-default-member-init] V[12:33:30.882] Dropped diagnostic: /workspace/git/emwobde/ml66_nps/radiolink/mars/cte/src/PlatformServices/RauHandler/public/TomHandler.h: use default member initializer for 'm_tomSender' [modernize-use-default-member-init] #0 0x00000000005589ef PrintStackTraceSignalHandler(void*) Signals.cpp:0:0 #1 0x0000000000556a2e SignalHandler(int) Signals.cpp:0:0 #2 0x00007efe4076c630 __restore_rt sigaction.c:0:0 #3 0x000000000130b460 clang::tidy::readability::StaticAccessedThroughInstanceCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0x130b460) #4 0x000000000209a6f1 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) ASTMatchFinder.cpp:0:0 #5 0x00000000020d37dc clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0x20d37dc) #6 0x000000000209bfbb clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::DynTypedNode const&) ASTMatchFinder.cpp:0:0 #7 0x00000000020bdb11 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseStmt(clang::Stmt*, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraitsclang::Stmt*, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraitsclang::Stmt* > > >) ASTMatchFinder.cpp:0:0 #8 0x00000000020bb817 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::dataTraverseNode(clang::Stmt, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraitsclang::Stmt*, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraitsclang::Stmt* > > >) ASTMatchFinder.cpp:0:0 #9 0x00000000020bda68 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseStmt(clang::Stmt, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraitsclang::Stmt*, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraitsclang::Stmt* > > >) ASTMatchFinder.cpp:0:0 #10 0x00000000020c1bd9 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseStmt(clang::Stmt, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraitsclang::Stmt*, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraitsclang::Stmt* > > >) (.constprop.6345) ASTMatchFinder.cpp:0:0 #11 0x00000000020cfcc2 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseFunctionHelper(clang::FunctionDecl) ASTMatchFinder.cpp:0:0 #12 0x00000000020b96e7 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0 #13 0x00000000020ba175 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0 #14 0x00000000020cf38f clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) ASTMatchFinder.cpp:0:0 #15 0x00000000020ba175 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0 #16 0x00000000020ba38b clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0x20ba38b) #17 0x0000000000c9ef03 clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_deleteclang::CompilerInvocation >, llvm::ArrayRefclang::clangd::Diag, std::shared_ptr<clang::clangd::PreambleData const>) (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0xc9ef03) #18 0x000000000043dc10 clang::clangd::(anonymous namespace)::Checker::buildAST() Check.cpp:0:0 #19 0x0000000000441e40 clang::clangd::check(llvm::StringRef, llvm::function_ref<bool (clang::clangd::Position const&)>, clang::clangd::ThreadsafeFS const&, clang::clangd::ClangdLSPServer::Options const&, bool) (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0x441e40) #20 0x000000000041b399 main (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0x41b399) #21 0x00007efe3f2c2555 __libc_start_main (/lib64/libc.so.6+0x22555) #22 0x000000000042ca41 _start (/afs/sero.gic.ericsson.se/app/vbuild/RHEL7-x86_64/clang/14.0.0/bin/clangd+0x42ca41) Segmentation fault (core dumped)

dennisoberg avatar Apr 27 '22 10:04 dennisoberg

Since the crash is occurring inside the implementation of a clang-tidy check, you should be able to work around it by disabling this particular check, e.g. by adding the following to your .clangd config file:

Diagnostics:
  ClangTidy:
    Remove: readability-static-accessed-through-instance

To investigate the crash further, we would need example source code that triggers it.

It would also be interesting to know if a standalone clang-tidy run (with this check enabled) triggers the crash.

HighCommander4 avatar Apr 27 '22 17:04 HighCommander4

Ok great. I will try that. I have another crash that is not clang-tidy. I create another report for that.

dennisoberg avatar Apr 28 '22 06:04 dennisoberg

When disabling readability-static-accessed-through-instance it does not crash due to clang-tidy anymore but then the other bug reported happens instead. https://github.com/clangd/clangd/issues/1130

dennisoberg avatar Apr 28 '22 06:04 dennisoberg

Only clang-tidy does not crash. See attached file.

dennisoberg avatar Apr 28 '22 06:04 dennisoberg