Upgrade clang-tools to 21 to fix clangd SIGSEGV on CUDA files#491
Open
fwilliams wants to merge 1 commit intoopenvdb:mainfrom
Open
Upgrade clang-tools to 21 to fix clangd SIGSEGV on CUDA files#491fwilliams wants to merge 1 commit intoopenvdb:mainfrom
fwilliams wants to merge 1 commit intoopenvdb:mainfrom
Conversation
clangd 18 crashes (SIGSEGV) when building ASTs for .cuh files compiled in CUDA mode. The crash occurs in Sema::MarkFunctionReferenced via Sema::ActOnCXXDelete when parsing `delete this;` in GCC 13.4.0's locale_classes.h (std::locale::facet::_M_remove_reference). This is a known clang 18 bug in CUDA host/device operator-delete resolution that is fixed in later versions. Bump clang-tools from 18 to 21 so the fvdb conda environment ships a working clangd. Because clang-tools=21 depends on clang-format=21, switch the clang-format and clang specs to the versioned package names (clang-format-18, clang-18) which coexist alongside the new metapackages and keep the clang-format-18 binary available as required by CI. Signed-off-by: Francis Williams <francis@fwilliams.info> Made-with: Cursor
Contributor
|
Why not use clang-tools 21 in CI as well? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clang-toolsfrom 18 to 21 in the dev conda environment to fix aclangdcrash (SIGSEGV) that occurs when building ASTs for.cuhfiles.operator deleteresolution, triggered bydelete this;in GCC 13.4.0'slocale_classes.h(std::locale::facet::_M_remove_reference). It is fixed in clang 21.clang-formatandclangspecs to versioned package names (clang-format-18,clang-18) so they coexist with theclang-tools=21dependency onclang-format=21. Theclang-format-18binary remains available as required by CI.Motivation
clangd(shipped viaclang-tools) crashes with a segmentation fault every time it tries to parse CUDA files that transitively include GCC's<locale>header (e.g. via PyTorch or standard library headers). This makes C++/CUDA language intelligence completely non-functional for affected files likeGaussianCameras.cuh.The crash stack trace:
Upgrading to clang-tools 21 (which bundles clangd 21) resolves the crash since the underlying CUDA
operator deleteresolution bug was fixed upstream.Test plan
clangd --check=src/fvdb/detail/ops/gsplat/GaussianCameras.cuhcompletes without crash on clangd 21clang-format-18 --versionstill reports 18.1.8 after the environment rebuildenv/dev_environment.ymland confirm clangd no longer crashes on CUDA filesMade with Cursor