llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.36k stars 12.14k forks source link

LLVM crash in clangd #117583

Closed harrisonmg closed 4 days ago

harrisonmg commented 4 days ago

I'm using clangd 19.1.0 through neovim and experiencing regular crashes. As requested by the error message, I am reporting the bug here. Below is the error and stack trace as they appear in my ~/.local/state/nvim/lsp.log. I believe this is reproduceable on this tag of the PX4 repository.. Crashing happens on a variety of files after doing a few "go to definition" commands or similar LSP actions.

After reading How to submit an LLVM bug report, I'm not sure what other information I should include. Please let me know if I can provide anything else.

[ERROR][2024-11-25 12:01:19] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        'I[12:01:19.979] ASTWorker building file /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp version 0 with command \n[/home/harrison/px4/build/cubepilot_cubeorange_default]\n/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ --target=arm-none-eabi --driver-mode=g++ -DCONFIG_ARCH_BOARD_CUBEPILOT_CUBEORANGE "-DMODULE_NAME=\\"uavcan\\"" "-DPX4_BOARD_LABEL=\\"default\\"" "-DPX4_BOARD_NAME=\\"CUBEPILOT_CUBEORANGE\\"" -DPX4_MAIN=uavcan_app_main -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_DRIVER=uavcan_stm32h7 -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN_PLATFORM=generic -DUAVCAN_STM32H7_NUM_IFACES=2 -DUAVCAN_STM32H7_NUTTX=1 -DUAVCAN_STM32H7_TIMER_NUMBER=5 -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/cubepilot/cubeorange/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -Isrc/drivers/uavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include -I../../src/drivers/uavcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan_drivers/posix/include -I../../src/drivers/uavcan/uavcan_drivers/stm32h7/driver/include -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -fno-rtti -nostdinc++ -fno-sized-deallocation -Wno-cast-align -Wno-deprecated-copy -Wno-address-of-packed-member -Wframe-larger-than=4096 -Wno-format-security -D__KERNEL__ -std=gnu++14 -o src/drivers/uavcan/CMakeFiles/drivers__uavcan.dir/sensors/sensor_bridge.cpp.obj -c -resource-dir=/home/harrison/.local/share/nvim/mason/packages/clangd/clangd_19.1.0/lib/clang/19 -- /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp\n'
[ERROR][2024-11-25 12:01:19] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:19.993] <-- textDocument/semanticTokens/full(15)\n"
[ERROR][2024-11-25 12:01:19] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:19.993] <-- textDocument/documentHighlight(16)\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:20.162] Built preamble of size 6033408 for file /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp version 0 in 0.18 seconds\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:20.162] --> workspace/semanticTokens/refresh(2)\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:20.162] <-- $/cancelRequest\nI[12:01:20.162] <-- textDocument/semanticTokens/full(17)\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:20.162] <-- reply(2)\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.\nI[12:01:20.331] <-- textDocument/signatureHelp(18)\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:20.339] --> reply:textDocument/signatureHelp(18) 7 ms\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"     "stderr"        "I[12:01:20.914] <-- textDocument/references(19)\n"
[ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770    "rpc"   "/home/harrison/.local/share/nvim/mason/bin/clangd"    "stderr"        ' #0 0x000000000055715b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13
#1 0x0000000000554fbe llvm::sys::RunSignalHandlers() /__w/clangd/clangd/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x0000000000557af6 SignalHandler(int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #3 0x00007f62f631cd00 __restore_rt (/lib64/libc.so.6+0x40d00)
 #4 0x000000000051f391 llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/StringMap.cpp:102:38
 #5 0x00000000038c6c7c std::pair<llvm::StringMapIterator<llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>>, bool> llvm::StringMap<llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>, llvm::MallocAllocator>::try_emplace_with_hash<llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>&>(llvm::StringRef, unsigned int, llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>&) /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/StringMap.h:376:25
 #6 0x00000000038c6b01 clang::tidy::boost::UseRangesCheck::getReplacerMap() const::$_0::operator()(llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>, std::initializer_list<llvm::StringRef>, llvm::StringRef) const /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp:211:31
 #7 0x00000000038c55f4 release /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:232:9
 #8 0x00000000038c55f4 ~IntrusiveRefCntPtr /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:196:27
 #9 0x00000000038c55f4 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp:220:9
#10 0x00000000038c55f4 clang::tidy::boost::UseRangesCheck::getReplacerMap() const /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp:234:3
#11 0x0000000003f6702d clang::tidy::utils::UseRangesCheck::registerMatchers(clang::ast_matchers::MatchFinder*) /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/utils/UseRangesCheck.cpp:112:23
#12 0x000000000170c291 operator++ /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:805:2
#13 0x000000000170c291 clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, llvm::ArrayRef<clang::clangd::Diag>, std::shared_ptr<clang::clangd::PreambleData const>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:563:28
#14 0x0000000001793925 ~__shared_count /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:683:6
#15 0x0000000001793925 ~__shared_ptr /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1123:31
#16 0x0000000001793925 clang::clangd::(anonymous namespace)::ASTWorker::generateDiagnostics(std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, clang::clangd::ParseInputs, std::vector<clang::clangd::Diag, std::allocator<clang::clangd::Diag>>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1210:39
#17 0x00000000017933cb clang::clangd::(anonymous namespace)::ASTWorker::updatePreamble(std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, clang::clangd::ParseInputs, std::shared_ptr<clang::clangd::PreambleData const>, std::vector<clang::clangd::Diag, std::allocator<clang::clangd::Diag>>, clang::clangd::WantDiagnostics)::$_2::operator()() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1144:5
#18 0x000000000178fbfb operator() /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
#19 0x000000000178fbfb clang::clangd::(anonymous namespace)::ASTWorker::runTask(llvm::StringRef, llvm::function_ref<void ()>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1324:3
#20 0x000000000178e650 run /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1459:5
#21 0x000000000178e650 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:822:42
#22 0x000000000178e650 void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang::clangd::(anonymous namespace)::ASTWorker::create(llvm::StringRef, clang::clangd::GlobalCompilationDatabase const&, clang::clangd::TUScheduler::ASTCache&, clang::clangd::TUScheduler::HeaderIncluderCache&, clang::clangd::AsyncTaskRunner*, clang::clangd::Semaphore&, clang::clangd::TUScheduler::Options const&, clang::clangd::ParsingCallbacks&)::$_7>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:220:12
#23 0x000000000190f9b1 operator= /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:48:5
#24 0x000000000190f9b1 PunnedPointer /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:37:60
#25 0x000000000190f9b1 PointerIntPair /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:86:13
#26 0x000000000190f9b1 UniqueFunctionBase /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:340:3
#27 0x000000000190f9b1 unique_function /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:369:3
#28 0x000000000190f9b1 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:103:14
#29 0x000000000190f9b1 operator()<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:43:11
#30 0x000000000190f9b1 __invoke_impl<void, (lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:60:14
#31 0x000000000190f9b1 __invoke<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:95:14
#32 0x000000000190f9b1 __apply_impl<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &, 0> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1662:14
#33 0x000000000190f9b1 apply<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1671:14
#34 0x000000000190f9b1 GenericThreadProxy<std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> > /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:41:5
#35 0x000000000190f9b1 void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::$_1>>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:55:5
#36 0x00007f62f63736d7 start_thread (/lib64/libc.so.6+0x976d7)
#37 0x00007f62f63f760c __GI___clone3 (/lib64/libc.so.6+0x11b60c)
Signalled during AST worker action: Build AST
  Filename: /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp
  Directory: /home/harrison/px4/build/cubepilot_cubeorange_default
  Command Line: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ --target=arm-none-eabi --driver-mode=g++ -DCONFIG_ARCH_BOARD_CUBEPILOT_CUBEORANGE -DMODULE_NAME="uavcan" -DPX4_BOARD_LABEL="default" -DPX4_BOARD_NAME="CUBEPILOT_CUBEORANGE" -DPX4_MAIN=uavcan_app_main -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_DRIVER=uavcan_stm32h7 -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN_PLATFORM=generic -DUAVCAN_STM32H7_NUM_IFACES=2 -DUAVCAN_STM32H7_NUTTX=1 -DUAVCAN_STM32H7_TIMER_NUMBER=5 -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/cubepilot/cubeorange/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules-I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -Isrc/drivers/uavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include -I../../src/drivers/uavcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan_drivers/posix/include -I../../src/drivers/uavcan/uavcan_drivers/stm32h7/driver/include -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -fno-rtti -nostdinc++ -fno-sized-deallocation -Wno-cast-align -Wno-deprecated-copy -Wno-address-of-packed-member -Wframe-larger-than=4096 -Wno-format-security -D__KERNEL__ -std=gnu++14 -o src/drivers/uavcan/CMakeFiles/drivers__uavcan.dir/sensors/sensor_bridge.cpp.obj -c -resource-dir=/home/harrison/.local/share/nvim/mason/packages/clangd/clangd_19.1.0/lib/clang/19 -- /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp
  Version: 0
'
llvmbot commented 4 days ago

@llvm/issue-subscribers-clangd

Author: Harrison (harrisonmg)

I'm using clangd 19.1.0 through neovim and experiencing regular crashes. As requested by the error message, I am reporting the bug here. Below is the error and stack trace as they appear in my `~/.local/state/nvim/lsp.log`. I believe this is reproduceable on [this tag of the PX4 repository.](https://github.com/PX4/PX4-Autopilot/tree/v1.13.3). Crashing happens on a variety of files after doing a few "go to definition" commands or similar LSP actions. After reading [How to submit an LLVM bug report](https://llvm.org/docs/HowToSubmitABug.html), I'm not sure what other information I should include. Please let me know if I can provide anything else. ``` [ERROR][2024-11-25 12:01:19] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" 'I[12:01:19.979] ASTWorker building file /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp version 0 with command \n[/home/harrison/px4/build/cubepilot_cubeorange_default]\n/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ --target=arm-none-eabi --driver-mode=g++ -DCONFIG_ARCH_BOARD_CUBEPILOT_CUBEORANGE "-DMODULE_NAME=\\"uavcan\\"" "-DPX4_BOARD_LABEL=\\"default\\"" "-DPX4_BOARD_NAME=\\"CUBEPILOT_CUBEORANGE\\"" -DPX4_MAIN=uavcan_app_main -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_DRIVER=uavcan_stm32h7 -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN_PLATFORM=generic -DUAVCAN_STM32H7_NUM_IFACES=2 -DUAVCAN_STM32H7_NUTTX=1 -DUAVCAN_STM32H7_TIMER_NUMBER=5 -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/cubepilot/cubeorange/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -Isrc/drivers/uavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include -I../../src/drivers/uavcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan_drivers/posix/include -I../../src/drivers/uavcan/uavcan_drivers/stm32h7/driver/include -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -fno-rtti -nostdinc++ -fno-sized-deallocation -Wno-cast-align -Wno-deprecated-copy -Wno-address-of-packed-member -Wframe-larger-than=4096 -Wno-format-security -D__KERNEL__ -std=gnu++14 -o src/drivers/uavcan/CMakeFiles/drivers__uavcan.dir/sensors/sensor_bridge.cpp.obj -c -resource-dir=/home/harrison/.local/share/nvim/mason/packages/clangd/clangd_19.1.0/lib/clang/19 -- /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp\n' [ERROR][2024-11-25 12:01:19] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:19.993] <-- textDocument/semanticTokens/full(15)\n" [ERROR][2024-11-25 12:01:19] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:19.993] <-- textDocument/documentHighlight(16)\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:20.162] Built preamble of size 6033408 for file /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp version 0 in 0.18 seconds\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:20.162] --> workspace/semanticTokens/refresh(2)\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:20.162] <-- $/cancelRequest\nI[12:01:20.162] <-- textDocument/semanticTokens/full(17)\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:20.162] <-- reply(2)\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.\nI[12:01:20.331] <-- textDocument/signatureHelp(18)\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:20.339] --> reply:textDocument/signatureHelp(18) 7 ms\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" "I[12:01:20.914] <-- textDocument/references(19)\n" [ERROR][2024-11-25 12:01:20] .../vim/lsp/rpc.lua:770 "rpc" "/home/harrison/.local/share/nvim/mason/bin/clangd" "stderr" ' #0 0x000000000055715b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13 #1 0x0000000000554fbe llvm::sys::RunSignalHandlers() /__w/clangd/clangd/llvm-project/llvm/lib/Support/Signals.cpp:106:18 #2 0x0000000000557af6 SignalHandler(int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1 #3 0x00007f62f631cd00 __restore_rt (/lib64/libc.so.6+0x40d00) #4 0x000000000051f391 llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/StringMap.cpp:102:38 #5 0x00000000038c6c7c std::pair<llvm::StringMapIterator<llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>>, bool> llvm::StringMap<llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>, llvm::MallocAllocator>::try_emplace_with_hash<llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>&>(llvm::StringRef, unsigned int, llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>&) /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/StringMap.h:376:25 #6 0x00000000038c6b01 clang::tidy::boost::UseRangesCheck::getReplacerMap() const::$_0::operator()(llvm::IntrusiveRefCntPtr<clang::tidy::utils::UseRangesCheck::Replacer>, std::initializer_list<llvm::StringRef>, llvm::StringRef) const /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp:211:31 #7 0x00000000038c55f4 release /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:232:9 #8 0x00000000038c55f4 ~IntrusiveRefCntPtr /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:196:27 #9 0x00000000038c55f4 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp:220:9 #10 0x00000000038c55f4 clang::tidy::boost::UseRangesCheck::getReplacerMap() const /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp:234:3 #11 0x0000000003f6702d clang::tidy::utils::UseRangesCheck::registerMatchers(clang::ast_matchers::MatchFinder*) /__w/clangd/clangd/llvm-project/clang-tools-extra/clang-tidy/utils/UseRangesCheck.cpp:112:23 #12 0x000000000170c291 operator++ /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:805:2 #13 0x000000000170c291 clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, llvm::ArrayRef<clang::clangd::Diag>, std::shared_ptr<clang::clangd::PreambleData const>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:563:28 #14 0x0000000001793925 ~__shared_count /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:683:6 #15 0x0000000001793925 ~__shared_ptr /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1123:31 #16 0x0000000001793925 clang::clangd::(anonymous namespace)::ASTWorker::generateDiagnostics(std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, clang::clangd::ParseInputs, std::vector<clang::clangd::Diag, std::allocator<clang::clangd::Diag>>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1210:39 #17 0x00000000017933cb clang::clangd::(anonymous namespace)::ASTWorker::updatePreamble(std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, clang::clangd::ParseInputs, std::shared_ptr<clang::clangd::PreambleData const>, std::vector<clang::clangd::Diag, std::allocator<clang::clangd::Diag>>, clang::clangd::WantDiagnostics)::$_2::operator()() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1144:5 #18 0x000000000178fbfb operator() /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12 #19 0x000000000178fbfb clang::clangd::(anonymous namespace)::ASTWorker::runTask(llvm::StringRef, llvm::function_ref<void ()>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1324:3 #20 0x000000000178e650 run /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1459:5 #21 0x000000000178e650 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:822:42 #22 0x000000000178e650 void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang::clangd::(anonymous namespace)::ASTWorker::create(llvm::StringRef, clang::clangd::GlobalCompilationDatabase const&, clang::clangd::TUScheduler::ASTCache&, clang::clangd::TUScheduler::HeaderIncluderCache&, clang::clangd::AsyncTaskRunner*, clang::clangd::Semaphore&, clang::clangd::TUScheduler::Options const&, clang::clangd::ParsingCallbacks&)::$_7>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:220:12 #23 0x000000000190f9b1 operator= /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:48:5 #24 0x000000000190f9b1 PunnedPointer /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:37:60 #25 0x000000000190f9b1 PointerIntPair /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:86:13 #26 0x000000000190f9b1 UniqueFunctionBase /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:340:3 #27 0x000000000190f9b1 unique_function /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:369:3 #28 0x000000000190f9b1 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:103:14 #29 0x000000000190f9b1 operator()<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:43:11 #30 0x000000000190f9b1 __invoke_impl<void, (lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:60:14 #31 0x000000000190f9b1 __invoke<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:95:14 #32 0x000000000190f9b1 __apply_impl<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &, 0> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1662:14 #33 0x000000000190f9b1 apply<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1671:14 #34 0x000000000190f9b1 GenericThreadProxy<std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> > /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:41:5 #35 0x000000000190f9b1 void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::$_1>>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:55:5 #36 0x00007f62f63736d7 start_thread (/lib64/libc.so.6+0x976d7) #37 0x00007f62f63f760c __GI___clone3 (/lib64/libc.so.6+0x11b60c) Signalled during AST worker action: Build AST Filename: /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp Directory: /home/harrison/px4/build/cubepilot_cubeorange_default Command Line: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ --target=arm-none-eabi --driver-mode=g++ -DCONFIG_ARCH_BOARD_CUBEPILOT_CUBEORANGE -DMODULE_NAME="uavcan" -DPX4_BOARD_LABEL="default" -DPX4_BOARD_NAME="CUBEPILOT_CUBEORANGE" -DPX4_MAIN=uavcan_app_main -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_DRIVER=uavcan_stm32h7 -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN_PLATFORM=generic -DUAVCAN_STM32H7_NUM_IFACES=2 -DUAVCAN_STM32H7_NUTTX=1 -DUAVCAN_STM32H7_TIMER_NUMBER=5 -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/cubepilot/cubeorange/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules-I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -Isrc/drivers/uavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include -I../../src/drivers/uavcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan_drivers/posix/include -I../../src/drivers/uavcan/uavcan_drivers/stm32h7/driver/include -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -fno-rtti -nostdinc++ -fno-sized-deallocation -Wno-cast-align -Wno-deprecated-copy -Wno-address-of-packed-member -Wframe-larger-than=4096 -Wno-format-security -D__KERNEL__ -std=gnu++14 -o src/drivers/uavcan/CMakeFiles/drivers__uavcan.dir/sensors/sensor_bridge.cpp.obj -c -resource-dir=/home/harrison/.local/share/nvim/mason/packages/clangd/clangd_19.1.0/lib/clang/19 -- /home/harrison/px4/src/drivers/uavcan/sensors/sensor_bridge.cpp Version: 0 ' ```
HighCommander4 commented 4 days ago

This is a 19.1.0 regression which has been fixed in 19.1.2.

HighCommander4 commented 4 days ago

Duplicate of https://github.com/llvm/llvm-project/issues/109367