Skip to content

[clangd] "Assertion 'LocalDeclID < LocalNumDecls' failed." when using clangd with --experimental-modules-support #130280

Open
@jiixyj

Description

@jiixyj

I'm trying out the new experimental module support of clangd with a ~25 KLOC large code base. On some files (~5 out of ~170), clangd crashes with an assertion failure in clang/lib/Serialization/ASTReader.cpp: "Assertion `LocalDeclID < LocalNumDecls' failed." With assertions disabled there are instead "random" crashes in the parser (I guess because of UB?).

The git hash is ff993f9 .

I haven't found a minimal, standalone reproducer yet, sadly. I have attached the output of clangd --compile-commands-dir=. --experimental-modules-support --check=src/ldgr/core.cppm and the backtrace in gdb.

Any ideas how to further debug this? I haven't found any pattern in the ~5 files that crash, although the crashes are reproducible.

clangd-output.txt
gdb-log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header ModulesclangdcrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions