Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang] 19.0.0 aborts due to Assertion !T->isDependentType() && "should not see dependent types here" failed in tools/clang/include/clang/AST/TypeNodes.inc #83684

Closed
bjrjk opened this issue Mar 2, 2024 · 3 comments · Fixed by #83688
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@bjrjk
Copy link

bjrjk commented Mar 2, 2024

Compile the following 1.cpp with command line clang++ -Xclang -fdump-record-layouts-complete 1.cpp cause a clang abort:

template <class Pointer>
struct AllocationResult {
  Pointer ptr = nullptr;
  int count = 0;
};
int main(){}

The attachment is crash backtrace, preprocessed source, and associated run script.
crashsite.zip

@github-actions github-actions bot added the clang Clang issues not falling into any other category label Mar 2, 2024
bjrjk added a commit to bjrjk/clang-object-layout-dumper that referenced this issue Mar 2, 2024
@Sirraide Sirraide added the confirmed Verified by a second party label Mar 2, 2024
@Sirraide
Copy link
Contributor

Sirraide commented Mar 2, 2024

Looking at the patch that added this (https://reviews.llvm.org/D104484), we may be trying to dump an uninstantiated class template, which doesn’t really make sense.

We’re also printing the layout of both __NSConstantString_tag and __va_list_tag, which seems a bit questionable. Perhaps we should skip implicitly defined records here.

@Sirraide
Copy link
Contributor

Sirraide commented Mar 2, 2024

Yeah, looks like that’s the problem.

@Sirraide Sirraide self-assigned this Mar 2, 2024
bjrjk added a commit to bjrjk/clang-object-layout-dumper that referenced this issue Mar 3, 2024
Sirraide added a commit that referenced this issue Mar 4, 2024
… `-fdump-record-layouts-complete` is passed (#83688)

We no longer try to compute and dump the layout of types in cases where that isn’t possible.

This fixes #83684 and #83671.
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" crash Prefer [crash-on-valid] or [crash-on-invalid] and removed clang Clang issues not falling into any other category labels Mar 4, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 4, 2024

@llvm/issue-subscribers-clang-frontend

Author: Jack Ren (bjrjk)

Compile the following `1.cpp` with command line `clang++ -Xclang -fdump-record-layouts-complete 1.cpp` cause a clang abort: ```cpp template <class Pointer> struct AllocationResult { Pointer ptr = nullptr; int count = 0; }; int main(){} ```

The attachment is crash backtrace, preprocessed source, and associated run script.
crashsite.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
4 participants