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

Crash when expanding over members_of #54

Closed
nilres opened this issue May 28, 2024 · 1 comment
Closed

Crash when expanding over members_of #54

nilres opened this issue May 28, 2024 · 1 comment

Comments

@nilres
Copy link

nilres commented May 28, 2024

Describe the bug

First of all: Thank you for the amazing work you did here.
Consider this minimal example code:

#include <experimental/meta>
#include <vector>

namespace __impl {
  template<auto... vals>
  struct replicator_type {
    template<typename F>
      constexpr void operator>>(F body) const {
        (body.template operator()<vals>(), ...);
      }
  };

  template<auto... vals>
  replicator_type<vals...> replicator = {};
}

template<typename R>
consteval auto expand(R range) {
  std::vector<std::meta::info> args;
  for (auto r : range) {
    args.push_back(std::meta::reflect_result(r));
  }
  return std::meta::substitute(^__impl::replicator, args);
}

class simple_test_class {
public:
    int a;

    void f() {

    }
};

template<typename T>
constexpr void create_function_member_information() {
    std::vector<int> result;
    [:expand(std::meta::members_of(^T)):] >> [&]<auto e> {
    };

}

int main() {
    create_function_member_information<simple_test_class>();

    return 0;
}

Compiling this with the latest checkout of this compiler results in a crash:

> build] clang++: /mnt/d/code/clang-p2996/clang/include/clang/AST/GlobalDecl.h:62: void clang::GlobalDecl::Init(const clang::Decl*): Assertion `!isa<CXXDestructorDecl>(D) && "Use other ctor with dtor decls!"' failed.
> [build] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
> [build] Stack dump:
> [build] 0.	Program arguments: /mnt/d/code/clang-p2996-build/bin/clang++ -Wall -Wextra -fexpansion-statements -nostdinc++ -nostdlib++ -isystem /mnt/d/code/clang-p2996-build/include/c++/v1 -isystem /mnt/d/code/clang-p2996-build/include/x86_64-unknown-linux-gnu/c++/v1/ -freflection -Wall -Wextra -g -std=gnu++26 -MD -MT CMakeFiles/runtime_reflection.dir/main.cpp.o -MF CMakeFiles/runtime_reflection.dir/main.cpp.o.d -o CMakeFiles/runtime_reflection.dir/main.cpp.o -c /mnt/d/code/runtime_reflection/main.cpp
> [build] 1.	/mnt/d/code/runtime_reflection/main.cpp:94:59: current parser token ')'
> [build] 2.	/mnt/d/code/runtime_reflection/main.cpp:93:12: parsing function body 'main'
> [build] 3.	/mnt/d/code/runtime_reflection/main.cpp:93:12: in compound statement ('{}')
> [build] 4.	/mnt/d/code/runtime_reflection/main.cpp:86:16: instantiating function definition 'create_function_member_information<simple_test_class>'
> [build] 5.	/mnt/d/code/runtime_reflection/main.cpp:58:22: instantiating function definition '__impl::replicator_type<(reflection), (reflection), (reflection), (reflection), (reflection), (reflection), (reflection), (reflection)>::operator>><(lambda at /mnt/d/code/runtime_reflection/main.cpp:88:46)>'
> [build] 6.	/mnt/d/code/runtime_reflection/main.cpp:88:46: instantiating function definition 'create_function_member_information()::(anonymous class)::operator()<(reflection)>'
> [build] 7.	/mnt/d/code/runtime_reflection/main.cpp:88:46: LLVM IR generation of declaration 'create_function_member_information()::(anonymous class)::operator()'
> [build] 8.	/mnt/d/code/runtime_reflection/main.cpp:88:46: Mangling declaration 'create_function_member_information()::(anonymous class)::operator()'
> [build]   #0 0x00007fc6ae070cdc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /mnt/d/code/clang-p2996/llvm/lib/Support/Unix/Signals.inc:723:22
> [build]   #1 0x00007fc6ae0710fd PrintStackTraceSignalHandler(void*) /mnt/d/code/clang-p2996/llvm/lib/Support/Unix/Signals.inc:798:1
> [build]   #2 0x00007fc6ae06e54d llvm::sys::RunSignalHandlers() /mnt/d/code/clang-p2996/llvm/lib/Support/Signals.cpp:105:20
> [build]   #3 0x00007fc6ae07043d llvm::sys::CleanupOnSignal(unsigned long) /mnt/d/code/clang-p2996/llvm/lib/Support/Unix/Signals.inc:367:31
> [build]   #4 0x00007fc6adf97216 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /mnt/d/code/clang-p2996/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
> [build]   #5 0x00007fc6adf97742 CrashRecoverySignalHandler(int) /mnt/d/code/clang-p2996/llvm/lib/Support/CrashRecoveryContext.cpp:391:1
> [build]   #6 0x00007fc6a8422520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
> [build]   #7 0x00007fc6a84769fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
> [build]   #8 0x00007fc6a84769fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
> [build]   #9 0x00007fc6a84769fc pthread_kill ./nptl/pthread_kill.c:89:10
> [build]  #10 0x00007fc6a8422476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
> [build]  #11 0x00007fc6a84087f3 abort ./stdlib/abort.c:81:7
> [build]  #12 0x00007fc6a840871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
> [build]  #13 0x00007fc6a8419e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
> [build]  #14 0x00007fc6ae3f9572 clang::GlobalDecl::Init(clang::Decl const*) /mnt/d/code/clang-p2996/clang/include/clang/AST/GlobalDecl.h:63:5
> [build]  #15 0x00007fc6ae604424 clang::GlobalDecl::GlobalDecl(clang::NamedDecl const*) /mnt/d/code/clang-p2996/clang/include/clang/AST/GlobalDecl.h:83:45
> [build]  #16 0x00007fc6b497da63 (anonymous namespace)::CXXNameMangler::mangleReflection(clang::ReflectionValue const&) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:4698:13
> [build]  #17 0x00007fc6b498338e (anonymous namespace)::CXXNameMangler::mangleTemplateArg(clang::TemplateArgument, bool) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:6211:5
> [build]  #18 0x00007fc6b498316d (anonymous namespace)::CXXNameMangler::mangleTemplateArg((anonymous namespace)::CXXNameMangler::TemplateArgManglingInfo&, unsigned int, clang::TemplateArgument) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:6175:20
> [build]  #19 0x00007fc6b4982f76 (anonymous namespace)::CXXNameMangler::mangleTemplateArgs(clang::TemplateName, clang::TemplateArgumentList const&) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:6141:22
> [build]  #20 0x00007fc6b4967ffd (anonymous namespace)::CXXNameMangler::mangleNestedName(clang::GlobalDecl, clang::DeclContext const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:1816:23
> [build]  #21 0x00007fc6b49687c0 (anonymous namespace)::CXXNameMangler::mangleLocalName(clang::GlobalDecl, llvm::SmallVector<llvm::StringRef, 4u> const*) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:1936:23
> [build]  #22 0x00007fc6b4965823 (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags(clang::GlobalDecl, llvm::SmallVector<llvm::StringRef, 4u> const*) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:1081:5
> [build]  #23 0x00007fc6b49655e1 (anonymous namespace)::CXXNameMangler::mangleName(clang::GlobalDecl) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:1047:1
> [build]  #24 0x00007fc6b49649ed (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding(clang::GlobalDecl) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:859:26
> [build]  #25 0x00007fc6b4964808 (anonymous namespace)::CXXNameMangler::mangle(clang::GlobalDecl) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:835:1
> [build]  #26 0x00007fc6b4987803 (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXName(clang::GlobalDecl, llvm::raw_ostream&) /mnt/d/code/clang-p2996/clang/lib/AST/ItaniumMangle.cpp:7179:1
> [build]  #27 0x00007fc6b49bb1c6 clang::MangleContext::mangleName(clang::GlobalDecl, llvm::raw_ostream&) /mnt/d/code/clang-p2996/clang/lib/AST/Mangle.cpp:193:5
> [build]  #28 0x00007fc6ae71d047 getMangledNameImpl(clang::CodeGen::CodeGenModule&, clang::GlobalDecl, clang::NamedDecl const*, bool) /mnt/d/code/clang-p2996/clang/lib/CodeGen/CodeGenModule.cpp:1811:18
> [build]  #29 0x00007fc6ae71dd6e clang::CodeGen::CodeGenModule::getMangledName(clang::GlobalDecl) /mnt/d/code/clang-p2996/clang/lib/CodeGen/CodeGenModule.cpp:1969:3
> [build]  #30 0x00007fc6ae7282f8 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) /mnt/d/code/clang-p2996/clang/lib/CodeGen/CodeGenModule.cpp:3832:41
> [build]  #31 0x00007fc6ae736327 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /mnt/d/code/clang-p2996/clang/lib/CodeGen/CodeGenModule.cpp:6807:37
> [build]  #32 0x00007fc6aeea481a (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) /mnt/d/code/clang-p2996/clang/lib/CodeGen/ModuleBuilder.cpp:189:7
> [build]  #33 0x00007fc6aee906cd clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /mnt/d/code/clang-p2996/clang/lib/CodeGen/CodeGenAction.cpp:201:7
> [build]  #34 0x00007fc6b3a710e3 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:5273:30
> [build]  #35 0x00007fc6b38e7e97 clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool)::'lambda0'()::operator()() const /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateDeduction.cpp:5509:5
> [build]  #36 0x00007fc6b38fc5d3 void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool)::'lambda0'()>(long) /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:40
> [build]  #37 0x00007fc6acba13a6 llvm::function_ref<void ()>::operator()() const /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:62
> [build]  #38 0x00007fc6b27f9b00 clang::runWithSufficientStackSpace(llvm::function_ref<void ()>, llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/clang/include/clang/Basic/Stack.h:52:3
> [build]  #39 0x00007fc6b27e7513 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/clang/lib/Sema/Sema.cpp:530:1
> [build]  #40 0x00007fc6b38e832b clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateDeduction.cpp:5512:42
> [build]  #41 0x00007fc6b2e02082 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:316:77
> [build]  #42 0x00007fc6b2d356dc clang::Sema::DiagnoseUseOfOverloadedDecl(clang::NamedDecl*, clang::SourceLocation) /mnt/d/code/clang-p2996/clang/include/clang/Sema/Sema.h:5245:29
> [build]  #43 0x00007fc6b3583c28 clang::Sema::BuildCallToMemberFunction(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaOverload.cpp:15564:41
> [build]  #44 0x00007fc6b2e1f1c0 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:6534:39
> [build]  #45 0x00007fc6b2e1e882 clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:6442:20
> [build]  #46 0x00007fc6b3a246e5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::RebuildCallExpr(clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:2887:35
> [build]  #47 0x00007fc6b39ff1f3 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:12646:38
> [build]  #48 0x00007fc6b39ebd3b clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) /mnt/d/code/clang-p2996-build/tools/clang/include/clang/AST/StmtNodes.inc:608:1
> [build]  #49 0x00007fc6b3a02e47 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXFoldExpr(clang::CXXFoldExpr*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:15675:48
> [build]  #50 0x00007fc6b39ec0ed clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) /mnt/d/code/clang-p2996-build/tools/clang/include/clang/AST/StmtNodes.inc:742:1
> [build]  #51 0x00007fc6b39f10e0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:4159:48
> [build]  #52 0x00007fc6b3a20f79 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:7969:51
> [build]  #53 0x00007fc6b3a18b5f clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:7952:1
> [build]  #54 0x00007fc6b39f0f07 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) /mnt/d/code/clang-p2996-build/tools/clang/include/clang/AST/StmtNodes.inc:1580:1
> [build]  #55 0x00007fc6b39e5914 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateInstantiate.cpp:4437:36
> [build]  #56 0x00007fc6b3a70f4a clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:5251:23
> [build]  #57 0x00007fc6b2e5884a clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()::operator()() const /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:18120:42
> [build]  #58 0x00007fc6b2ea8836 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:40
> [build]  #59 0x00007fc6acba13a6 llvm::function_ref<void ()>::operator()() const /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:62
> [build]  #60 0x00007fc6b27f9b00 clang::runWithSufficientStackSpace(llvm::function_ref<void ()>, llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/clang/include/clang/Basic/Stack.h:52:3
> [build]  #61 0x00007fc6b27e7513 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/clang/lib/Sema/Sema.cpp:530:1
> [build]  #62 0x00007fc6b2e58e29 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:18142:69
> [build]  #63 0x00007fc6b2e60396 clang::Sema::MarkAnyDeclReferenced(clang::SourceLocation, clang::Decl*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:19910:5
> [build]  #64 0x00007fc6b2e5fe61 MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:19823:46
> [build]  #65 0x00007fc6b2e60149 clang::Sema::MarkDeclRefReferenced(clang::DeclRefExpr*, clang::Expr const*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:19867:1
> [build]  #66 0x00007fc6b354604a CreateFunctionRefExpr(clang::Sema&, clang::FunctionDecl*, clang::NamedDecl*, clang::Expr const*, bool, clang::SourceLocation, clang::DeclarationNameLoc const&) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaOverload.cpp:85:31
> [build]  #67 0x00007fc6b357f85f clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*, bool, bool, clang::FunctionDecl*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaOverload.cpp:14837:50
> [build]  #68 0x00007fc6b2e4ad68 BuildOverloadedBinOp(clang::Sema&, clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:15231:33
> [build]  #69 0x00007fc6b2e4b648 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:15329:73
> [build]  #70 0x00007fc6b3a2569b clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::RebuildBinaryOperator(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:2990:3
> [build]  #71 0x00007fc6b3a058bf clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformBinaryOperator(clang::BinaryOperator*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:12767:44
> [build]  #72 0x00007fc6b39ec347 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) /mnt/d/code/clang-p2996-build/tools/clang/include/clang/AST/StmtNodes.inc:828:1
> [build]  #73 0x00007fc6b39f10e0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:4159:48
> [build]  #74 0x00007fc6b3a20f79 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:7969:51
> [build]  #75 0x00007fc6b3a18b5f clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*) /mnt/d/code/clang-p2996/clang/lib/Sema/TreeTransform.h:7952:1
> [build]  #76 0x00007fc6b39f0f07 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) /mnt/d/code/clang-p2996-build/tools/clang/include/clang/AST/StmtNodes.inc:1580:1
> [build]  #77 0x00007fc6b39e5914 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateInstantiate.cpp:4437:36
> [build]  #78 0x00007fc6b3a70f4a clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:5251:23
> [build]  #79 0x00007fc6b2e5884a clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()::operator()() const /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:18120:42
> [build]  #80 0x00007fc6b2ea8836 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:40
> [build]  #81 0x00007fc6acba13a6 llvm::function_ref<void ()>::operator()() const /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:62
> [build]  #82 0x00007fc6b27f9b00 clang::runWithSufficientStackSpace(llvm::function_ref<void ()>, llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/clang/include/clang/Basic/Stack.h:52:3
> [build]  #83 0x00007fc6b27e7513 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/clang/lib/Sema/Sema.cpp:530:1
> [build]  #84 0x00007fc6b2e58e29 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:18142:69
> [build]  #85 0x00007fc6b2e60396 clang::Sema::MarkAnyDeclReferenced(clang::SourceLocation, clang::Decl*, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:19910:5
> [build]  #86 0x00007fc6b2e5fe61 MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:19823:46
> [build]  #87 0x00007fc6b2e60149 clang::Sema::MarkDeclRefReferenced(clang::DeclRefExpr*, clang::Expr const*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:19867:1
> [build]  #88 0x00007fc6b2e0b6ea clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:2315:53
> [build]  #89 0x00007fc6b3588c84 clang::Sema::FixOverloadedFunctionReference(clang::Expr*, clang::DeclAccessPair, clang::FunctionDecl*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaOverload.cpp:16410:40
> [build]  #90 0x00007fc6b357bb05 FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaOverload.cpp:14073:47
> [build]  #91 0x00007fc6b357c6e3 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaOverload.cpp:14206:34
> [build]  #92 0x00007fc6b2e1f37a clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:6551:39
> [build]  #93 0x00007fc6b2e1e882 clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) /mnt/d/code/clang-p2996/clang/lib/Sema/SemaExpr.cpp:6442:20
> [build]  #94 0x00007fc6b26bbafd clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseExpr.cpp:2239:36
> [build]  #95 0x00007fc6b26b9fe5 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*, clang::SourceLocation) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseExpr.cpp:1941:37
> [build]  #96 0x00007fc6b26b45c0 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseExpr.cpp:714:39
> [build]  #97 0x00007fc6b26b1b90 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseExpr.cpp:184:39
> [build]  #98 0x00007fc6b26b18c5 clang::Parser::ParseExpression(clang::Parser::TypeCastState) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseExpr.cpp:135:43
> [build]  #99 0x00007fc6b2743fea clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseStmt.cpp:548:34
> [build] #100 0x00007fc6b2742b18 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseStmt.cpp:281:32
> [build] #101 0x00007fc6b2741f23 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseStmt.cpp:121:62
> [build] #102 0x00007fc6b27469bd clang::Parser::ParseCompoundStatementBody(bool) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseStmt.cpp:1245:38
> [build] #103 0x00007fc6b274c0de clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseStmt.cpp:2548:47
> [build] #104 0x00007fc6b2623123 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /mnt/d/code/clang-p2996/clang/lib/Parse/Parser.cpp:1540:36
> [build] #105 0x00007fc6b2654d00 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseDecl.cpp:2388:40
> [build] #106 0x00007fc6b2621cd5 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /mnt/d/code/clang-p2996/clang/lib/Parse/Parser.cpp:1264:24
> [build] #107 0x00007fc6b2621ecf clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /mnt/d/code/clang-p2996/clang/lib/Parse/Parser.cpp:1286:42
> [build] #108 0x00007fc6b2621111 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /mnt/d/code/clang-p2996/clang/lib/Parse/Parser.cpp:1089:50
> [build] #109 0x00007fc6b261ff34 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /mnt/d/code/clang-p2996/clang/lib/Parse/Parser.cpp:778:36
> [build] #110 0x00007fc6b261aeda clang::ParseAST(clang::Sema&, bool, bool) /mnt/d/code/clang-p2996/clang/lib/Parse/ParseAST.cpp:163:37
> [build] #111 0x00007fc6af1ca52a clang::ASTFrontendAction::ExecuteAction() /mnt/d/code/clang-p2996/clang/lib/Frontend/FrontendAction.cpp:1192:11
> [build] #112 0x00007fc6aee95946 clang::CodeGenAction::ExecuteAction() /mnt/d/code/clang-p2996/clang/lib/CodeGen/CodeGenAction.cpp:1147:5
> [build] #113 0x00007fc6af1c9dd4 clang::FrontendAction::Execute() /mnt/d/code/clang-p2996/clang/lib/Frontend/FrontendAction.cpp:1082:38
> [build] #114 0x00007fc6af0d4cad clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /mnt/d/code/clang-p2996/clang/lib/Frontend/CompilerInstance.cpp:1061:42
> [build] #115 0x00007fc6af3885e3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /mnt/d/code/clang-p2996/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:280:38
> [build] #116 0x00007fc6a9f373b3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /mnt/d/code/clang-p2996/clang/tools/driver/cc1_main.cpp:232:40
> [build] #117 0x00007fc6a9f28196 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /mnt/d/code/clang-p2996/clang/tools/driver/driver.cpp:215:20
> [build] #118 0x00007fc6a9f283b5 clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)::operator()(llvm::SmallVectorImpl<char const*>&) const /mnt/d/code/clang-p2996/clang/tools/driver/driver.cpp:356:5
> [build] #119 0x00007fc6a9f29a87 int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:47:3
> [build] #120 0x00007fc6aef15689 llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::operator()(llvm::SmallVectorImpl<char const*>&) const /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:3
> [build] #121 0x00007fc6aef1437e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()::operator()() const /mnt/d/code/clang-p2996/clang/lib/Driver/Job.cpp:440:32
> [build] #122 0x00007fc6aef1483d void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:40
> [build] #123 0x00007fc6acba13a6 llvm::function_ref<void ()>::operator()() const /mnt/d/code/clang-p2996/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:62
> [build] #124 0x00007fc6adf9795f llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /mnt/d/code/clang-p2996/llvm/lib/Support/CrashRecoveryContext.cpp:427:10
> [build] #125 0x00007fc6aef1459b clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const /mnt/d/code/clang-p2996/clang/lib/Driver/Job.cpp:440:7
> [build] #126 0x00007fc6aeeaeb6b clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const /mnt/d/code/clang-p2996/clang/lib/Driver/Compilation.cpp:199:22
> [build] #127 0x00007fc6aeeaeeec clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const /mnt/d/code/clang-p2996/clang/lib/Driver/Compilation.cpp:253:62
> [build] #128 0x00007fc6aeec2591 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) /mnt/d/code/clang-p2996/clang/lib/Driver/Driver.cpp:1942:28
> [build] #129 0x00007fc6a9f295bd clang_main(int, char**, llvm::ToolContext const&) /mnt/d/code/clang-p2996/clang/tools/driver/driver.cpp:391:39
> [build] #130 0x00007fc6a9f63e8c main /mnt/d/code/clang-p2996-build/tools/clang/tools/driver/clang-driver.cpp:17:20
> [build] #131 0x00007fc6a8409d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
> [build] #132 0x00007fc6a8409e40 call_init ./csu/../csu/libc-start.c:128:20
> [build] #133 0x00007fc6a8409e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
> [build] #134 0x00007fc6a9f27525 _start (/mnt/d/code/clang-p2996-build/bin/clang+++0x1524525)
> [build] clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
> [build] clang version 19.0.0git (https://github.com/bloomberg/clang-p2996.git 0994a5ad9cf4ca20b56cde930a0bc35b0e8240cf)
> [build] Target: x86_64-unknown-linux-gnu
> [build] Thread model: posix
> [build] InstalledDir: /mnt/d/code/clang-p2996-build/bin
> [build] Build config: +unoptimized, +assertions
> [build] clang++: note: diagnostic msg: 
> [build] ********************
> [build] 
> [build] PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> [build] Preprocessed source(s) and associated run script(s) are located at:
> [build] clang++: note: diagnostic msg: /tmp/main-9eb3f9.cpp
> [build] clang++: note: diagnostic msg: /tmp/main-9eb3f9.sh
> [build] clang++: note: diagnostic msg: 
> [build] 
> [build] ********************
> [build] gmake[2]: *** [CMakeFiles/runtime_reflection.dir/build.make:76: CMakeFiles/runtime_reflection.dir/main.cpp.o] Error 1
> [build] gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/runtime_reflection.dir/all] Error 2
> [build] gmake: *** [Makefile:91: all] Error 2
> [proc] The command: /opt/cmake/bin/cmake --build /mnt/d/code/runtime_reflection/build --config Debug --target all -j 18 -- exited with code: 2
> [driver] Build completed: 00:00:52.988
> [build] Build finished with exit code 2

The interesting part is: If I change the std::meta::members_of to std::meta::nonstatic_data_members_of the compiles and works as expected. So it seems closely related to the std::meta::members_of implementation.

Environment (please complete the following information):

  • I tested this on two different systems both on Windows using a WSL environment with Ubuntu 22.04

Additional context
If you need any other debug information I will do my best to provide it

@katzdm
Copy link
Collaborator

katzdm commented May 30, 2024

Thanks for the bug report! This is now fixed at HEAD, and should be fixed on Godbolt the day after tomorrow.

@katzdm katzdm closed this as completed May 30, 2024
katzdm pushed a commit that referenced this issue Jul 13, 2024
…arallel fusion llvm#94391 (llvm#97607)"

This reverts commit edbc0e3.

Reason for rollback. ASAN complains about this PR:

==4320==ERROR: AddressSanitizer: heap-use-after-free on address 0x502000006cd8 at pc 0x55e2978d63cf bp 0x7ffe6431c2b0 sp 0x7ffe6431c2a8
READ of size 8 at 0x502000006cd8 thread T0
    #0 0x55e2978d63ce in map<llvm::MutableArrayRef<mlir::BlockArgument> &, llvm::MutableArrayRef<mlir::BlockArgument>, nullptr> mlir/include/mlir/IR/IRMapping.h:40:11
    #1 0x55e2978d63ce in mlir::createFused(mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface, mlir::RewriterBase&, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)>, llvm::function_ref<void (mlir::RewriterBase&, mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface&, mlir::IRMapping)>) mlir/lib/Interfaces/LoopLikeInterface.cpp:156:11
    #2 0x55e2952a614b in mlir::fuseIndependentSiblingForLoops(mlir::scf::ForOp, mlir::scf::ForOp, mlir::RewriterBase&) mlir/lib/Dialect/SCF/Utils/Utils.cpp:1398:43
    #3 0x55e291480c6f in mlir::transform::LoopFuseSiblingOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp:482:17
    #4 0x55e29149ed5e in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::LoopFuseSiblingOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #5 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #6 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #7 0x55e294646a8d in applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:1788:15
    #8 0x55e29464f927 in mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:2155:10
    #9 0x55e2945d28ee in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::NamedSequenceOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #10 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #11 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #12 0x55e2974a5fe2 in mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>> const&, mlir::transform::TransformOptions const&, bool) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:2016:16
    #13 0x55e2945888d7 in mlir::transform::applyTransformNamedSequence(mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>>, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) mlir/lib/Dialect/Transform/Transforms/TransformInterpreterUtils.cpp:234:10
    #14 0x55e294582446 in (anonymous namespace)::InterpreterPass::runOnOperation() mlir/lib/Dialect/Transform/Transforms/InterpreterPass.cpp:147:16
    #15 0x55e2978e93c6 in operator() mlir/lib/Pass/Pass.cpp:527:17
    #16 0x55e2978e93c6 in void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #17 0x55e2978e207a in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #18 0x55e2978e207a in executeAction<mlir::PassExecutionAction, mlir::Pass &> mlir/include/mlir/IR/MLIRContext.h:275:7
    #19 0x55e2978e207a in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) mlir/lib/Pass/Pass.cpp:521:21
    #20 0x55e2978e5fbf in runPipeline mlir/lib/Pass/Pass.cpp:593:16
    #21 0x55e2978e5fbf in mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) mlir/lib/Pass/Pass.cpp:904:10
    #22 0x55e2978e5b65 in mlir::PassManager::run(mlir::Operation*) mlir/lib/Pass/Pass.cpp:884:60
    #23 0x55e291ebb460 in performActions(llvm::raw_ostream&, std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:408:17
    #24 0x55e291ebabd9 in processBuffer mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:481:9
    #25 0x55e291ebabd9 in operator() mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:548:12
    #26 0x55e291ebabd9 in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #27 0x55e297b1cffe in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #28 0x55e297b1cffe in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const mlir/lib/Support/ToolUtilities.cpp:86:16
    #29 0x55e297b1c9c5 in interleave<const llvm::StringRef *, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), (lambda at llvm/include/llvm/ADT/STLExtras.h:2147:49), void> llvm/include/llvm/ADT/STLExtras.h:2125:3
    #30 0x55e297b1c9c5 in interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), llvm::raw_ostream, llvm::StringRef> llvm/include/llvm/ADT/STLExtras.h:2147:3
    #31 0x55e297b1c9c5 in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) mlir/lib/Support/ToolUtilities.cpp:89:3
    #32 0x55e291eb0cf0 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:551:10
    #33 0x55e291eb115c in mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:589:14
    #34 0x55e291eb15f8 in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:605:10
    #35 0x55e29130d1be in main mlir/tools/mlir-opt/mlir-opt.cpp:311:33
    #36 0x7fbcf3fff3d3 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x613d3) (BuildId: 9a996398ce14a94560b0c642eb4f6e94)
    #37 0x55e2912365a9 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

0x502000006cd8 is located 8 bytes inside of 16-byte region [0x502000006cd0,0x502000006ce0)
freed by thread T0 here:
    #0 0x55e29130b7e2 in operator delete(void*, unsigned long) compiler-rt/lib/asan/asan_new_delete.cpp:155:3
    #1 0x55e2979eb657 in __libcpp_operator_delete<void *, unsigned long>
    #2 0x55e2979eb657 in __do_deallocate_handle_size<>
    #3 0x55e2979eb657 in __libcpp_deallocate
    #4 0x55e2979eb657 in deallocate
    #5 0x55e2979eb657 in deallocate
    #6 0x55e2979eb657 in operator()
    #7 0x55e2979eb657 in ~vector
    #8 0x55e2979eb657 in mlir::Block::~Block() mlir/lib/IR/Block.cpp:24:1
    #9 0x55e2979ebc17 in deleteNode llvm/include/llvm/ADT/ilist.h:42:39
    #10 0x55e2979ebc17 in erase llvm/include/llvm/ADT/ilist.h:205:5
    #11 0x55e2979ebc17 in erase llvm/include/llvm/ADT/ilist.h:209:39
    #12 0x55e2979ebc17 in mlir::Block::erase() mlir/lib/IR/Block.cpp:67:28
    #13 0x55e297aef978 in mlir::RewriterBase::eraseBlock(mlir::Block*) mlir/lib/IR/PatternMatch.cpp:245:10
    #14 0x55e297af0563 in mlir::RewriterBase::inlineBlockBefore(mlir::Block*, mlir::Block*, llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, false, false, void, false, void>, false, false>, mlir::ValueRange) mlir/lib/IR/PatternMatch.cpp:331:3
    #15 0x55e297af06d8 in mlir::RewriterBase::mergeBlocks(mlir::Block*, mlir::Block*, mlir::ValueRange) mlir/lib/IR/PatternMatch.cpp:341:3
    #16 0x55e297036608 in mlir::scf::ForOp::replaceWithAdditionalYields(mlir::RewriterBase&, mlir::ValueRange, bool, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)> const&) mlir/lib/Dialect/SCF/IR/SCF.cpp:575:12
    #17 0x55e2970673ca in mlir::detail::LoopLikeOpInterfaceInterfaceTraits::Model<mlir::scf::ForOp>::replaceWithAdditionalYields(mlir::detail::LoopLikeOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::RewriterBase&, mlir::ValueRange, bool, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)> const&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Interfaces/LoopLikeInterface.h.inc:658:56
    #18 0x55e2978d5feb in replaceWithAdditionalYields blaze-out/k8-opt-asan/bin/mlir/include/mlir/Interfaces/LoopLikeInterface.cpp.inc:105:14
    #19 0x55e2978d5feb in mlir::createFused(mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface, mlir::RewriterBase&, std::__u::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::Location, llvm::ArrayRef<mlir::BlockArgument>)>, llvm::function_ref<void (mlir::RewriterBase&, mlir::LoopLikeOpInterface, mlir::LoopLikeOpInterface&, mlir::IRMapping)>) mlir/lib/Interfaces/LoopLikeInterface.cpp:135:14
    #20 0x55e2952a614b in mlir::fuseIndependentSiblingForLoops(mlir::scf::ForOp, mlir::scf::ForOp, mlir::RewriterBase&) mlir/lib/Dialect/SCF/Utils/Utils.cpp:1398:43
    #21 0x55e291480c6f in mlir::transform::LoopFuseSiblingOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp:482:17
    #22 0x55e29149ed5e in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::LoopFuseSiblingOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #23 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #24 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #25 0x55e294646a8d in applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:1788:15
    #26 0x55e29464f927 in mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) mlir/lib/Dialect/Transform/IR/TransformOps.cpp:2155:10
    #27 0x55e2945d28ee in mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::NamedSequenceOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h.inc:477:56
    #28 0x55e297494a60 in apply blaze-out/k8-opt-asan/bin/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc:61:14
    #29 0x55e297494a60 in mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:953:48
    #30 0x55e2974a5fe2 in mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>> const&, mlir::transform::TransformOptions const&, bool) mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:2016:16
    #31 0x55e2945888d7 in mlir::transform::applyTransformNamedSequence(mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>>, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) mlir/lib/Dialect/Transform/Transforms/TransformInterpreterUtils.cpp:234:10
    #32 0x55e294582446 in (anonymous namespace)::InterpreterPass::runOnOperation() mlir/lib/Dialect/Transform/Transforms/InterpreterPass.cpp:147:16
    #33 0x55e2978e93c6 in operator() mlir/lib/Pass/Pass.cpp:527:17
    #34 0x55e2978e93c6 in void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #35 0x55e2978e207a in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #36 0x55e2978e207a in executeAction<mlir::PassExecutionAction, mlir::Pass &> mlir/include/mlir/IR/MLIRContext.h:275:7
    #37 0x55e2978e207a in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) mlir/lib/Pass/Pass.cpp:521:21
    #38 0x55e2978e5fbf in runPipeline mlir/lib/Pass/Pass.cpp:593:16
    #39 0x55e2978e5fbf in mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) mlir/lib/Pass/Pass.cpp:904:10
    #40 0x55e2978e5b65 in mlir::PassManager::run(mlir::Operation*) mlir/lib/Pass/Pass.cpp:884:60
    #41 0x55e291ebb460 in performActions(llvm::raw_ostream&, std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:408:17
    #42 0x55e291ebabd9 in processBuffer mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:481:9
    #43 0x55e291ebabd9 in operator() mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:548:12
    #44 0x55e291ebabd9 in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #45 0x55e297b1cffe in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #46 0x55e297b1cffe in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const mlir/lib/Support/ToolUtilities.cpp:86:16
    #47 0x55e297b1c9c5 in interleave<const llvm::StringRef *, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), (lambda at llvm/include/llvm/ADT/STLExtras.h:2147:49), void> llvm/include/llvm/ADT/STLExtras.h:2125:3
    #48 0x55e297b1c9c5 in interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), llvm::raw_ostream, llvm::StringRef> llvm/include/llvm/ADT/STLExtras.h:2147:3
    #49 0x55e297b1c9c5 in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) mlir/lib/Support/ToolUtilities.cpp:89:3
    #50 0x55e291eb0cf0 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:551:10
    #51 0x55e291eb115c in mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:589:14

previously allocated by thread T0 here:
    #0 0x55e29130ab5d in operator new(unsigned long) compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55e2979ed5d4 in __libcpp_operator_new<unsigned long>
    #2 0x55e2979ed5d4 in __libcpp_allocate
    #3 0x55e2979ed5d4 in allocate
    #4 0x55e2979ed5d4 in __allocate_at_least<std::__u::allocator<mlir::BlockArgument> >
    #5 0x55e2979ed5d4 in __split_buffer
    #6 0x55e2979ed5d4 in mlir::BlockArgument* std::__u::vector<mlir::BlockArgument, std::__u::allocator<mlir::BlockArgument>>::__push_back_slow_path<mlir::BlockArgument const&>(mlir::BlockArgument const&)
    #7 0x55e2979ec0f2 in push_back
    #8 0x55e2979ec0f2 in mlir::Block::addArgument(mlir::Type, mlir::Location) mlir/lib/IR/Block.cpp:154:13
    #9 0x55e29796e457 in parseRegionBody mlir/lib/AsmParser/Parser.cpp:2172:34
    #10 0x55e29796e457 in (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:2121:7
    #11 0x55e29796b25e in (anonymous namespace)::CustomOpAsmParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:1785:16
    #12 0x55e297035742 in mlir::scf::ForOp::parse(mlir::OpAsmParser&, mlir::OperationState&) mlir/lib/Dialect/SCF/IR/SCF.cpp:521:14
    #13 0x55e291322c18 in llvm::ParseResult llvm::detail::UniqueFunctionBase<llvm::ParseResult, mlir::OpAsmParser&, mlir::OperationState&>::CallImpl<llvm::ParseResult (*)(mlir::OpAsmParser&, mlir::OperationState&)>(void*, mlir::OpAsmParser&, mlir::OperationState&) llvm/include/llvm/ADT/FunctionExtras.h:220:12
    #14 0x55e29795bea3 in operator() llvm/include/llvm/ADT/FunctionExtras.h:384:12
    #15 0x55e29795bea3 in callback_fn<llvm::unique_function<llvm::ParseResult (mlir::OpAsmParser &, mlir::OperationState &)> > llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #16 0x55e29795bea3 in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #17 0x55e29795bea3 in parseOperation mlir/lib/AsmParser/Parser.cpp:1521:9
    #18 0x55e29795bea3 in parseCustomOperation mlir/lib/AsmParser/Parser.cpp:2017:19
    #19 0x55e29795bea3 in (anonymous namespace)::OperationParser::parseOperation() mlir/lib/AsmParser/Parser.cpp:1174:10
    #20 0x55e297971d20 in parseBlockBody mlir/lib/AsmParser/Parser.cpp:2296:9
    #21 0x55e297971d20 in (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) mlir/lib/AsmParser/Parser.cpp:2226:12
    #22 0x55e29796e4f5 in parseRegionBody mlir/lib/AsmParser/Parser.cpp:2184:7
    #23 0x55e29796e4f5 in (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:2121:7
    #24 0x55e29796b25e in (anonymous namespace)::CustomOpAsmParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:1785:16
    #25 0x55e29796b2cf in (anonymous namespace)::CustomOpAsmParser::parseOptionalRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) mlir/lib/AsmParser/Parser.cpp:1796:12
    #26 0x55e2978d89ff in mlir::function_interface_impl::parseFunctionOp(mlir::OpAsmParser&, mlir::OperationState&, bool, mlir::StringAttr, llvm::function_ref<mlir::Type (mlir::Builder&, llvm::ArrayRef<mlir::Type>, llvm::ArrayRef<mlir::Type>, mlir::function_interface_impl::VariadicFlag, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>&)>, mlir::StringAttr, mlir::StringAttr) mlir/lib/Interfaces/FunctionImplementation.cpp:232:14
    #27 0x55e2969ba41d in mlir::func::FuncOp::parse(mlir::OpAsmParser&, mlir::OperationState&) mlir/lib/Dialect/Func/IR/FuncOps.cpp:203:10
    #28 0x55e291322c18 in llvm::ParseResult llvm::detail::UniqueFunctionBase<llvm::ParseResult, mlir::OpAsmParser&, mlir::OperationState&>::CallImpl<llvm::ParseResult (*)(mlir::OpAsmParser&, mlir::OperationState&)>(void*, mlir::OpAsmParser&, mlir::OperationState&) llvm/include/llvm/ADT/FunctionExtras.h:220:12
    #29 0x55e29795bea3 in operator() llvm/include/llvm/ADT/FunctionExtras.h:384:12
    #30 0x55e29795bea3 in callback_fn<llvm::unique_function<llvm::ParseResult (mlir::OpAsmParser &, mlir::OperationState &)> > llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #31 0x55e29795bea3 in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #32 0x55e29795bea3 in parseOperation mlir/lib/AsmParser/Parser.cpp:1521:9
    #33 0x55e29795bea3 in parseCustomOperation mlir/lib/AsmParser/Parser.cpp:2017:19
    #34 0x55e29795bea3 in (anonymous namespace)::OperationParser::parseOperation() mlir/lib/AsmParser/Parser.cpp:1174:10
    #35 0x55e297959b78 in parse mlir/lib/AsmParser/Parser.cpp:2725:20
    #36 0x55e297959b78 in mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) mlir/lib/AsmParser/Parser.cpp:2785:41
    #37 0x55e29790d5c2 in mlir::parseSourceFile(std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) mlir/lib/Parser/Parser.cpp:46:10
    #38 0x55e291ebbfe2 in parseSourceFile<mlir::ModuleOp, const std::__u::shared_ptr<llvm::SourceMgr> &> mlir/include/mlir/Parser/Parser.h:159:14
    #39 0x55e291ebbfe2 in parseSourceFile<mlir::ModuleOp> mlir/include/mlir/Parser/Parser.h:189:10
    #40 0x55e291ebbfe2 in mlir::parseSourceFileForTool(std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) mlir/include/mlir/Tools/ParseUtilities.h:31:12
    #41 0x55e291ebb263 in performActions(llvm::raw_ostream&, std::__u::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:383:33
    #42 0x55e291ebabd9 in processBuffer mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:481:9
    #43 0x55e291ebabd9 in operator() mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:548:12
    #44 0x55e291ebabd9 in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #45 0x55e297b1cffe in operator() llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #46 0x55e297b1cffe in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const mlir/lib/Support/ToolUtilities.cpp:86:16
    #47 0x55e297b1c9c5 in interleave<const llvm::StringRef *, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), (lambda at llvm/include/llvm/ADT/STLExtras.h:2147:49), void> llvm/include/llvm/ADT/STLExtras.h:2125:3
    #48 0x55e297b1c9c5 in interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at mlir/lib/Support/ToolUtilities.cpp:79:23), llvm::raw_ostream, llvm::StringRef> llvm/include/llvm/ADT/STLExtras.h:2147:3
    #49 0x55e297b1c9c5 in mlir::splitAndProcessBuffer(std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) mlir/lib/Support/ToolUtilities.cpp:89:3
    #50 0x55e291eb0cf0 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:551:10
    #51 0x55e291eb115c in mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:589:14
    #52 0x55e291eb15f8 in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:605:10
    #53 0x55e29130d1be in main mlir/tools/mlir-opt/mlir-opt.cpp:311:33
    #54 0x7fbcf3fff3d3 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x613d3) (BuildId: 9a996398ce14a94560b0c642eb4f6e94)
    #55 0x55e2912365a9 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

SUMMARY: AddressSanitizer: heap-use-after-free mlir/include/mlir/IR/IRMapping.h:40:11 in map<llvm::MutableArrayRef<mlir::BlockArgument> &, llvm::MutableArrayRef<mlir::BlockArgument>, nullptr>
Shadow bytes around the buggy address:
  0x502000006a00: fa fa 00 fa fa fa 00 00 fa fa 00 fa fa fa 00 fa
  0x502000006a80: fa fa 00 fa fa fa 00 00 fa fa 00 00 fa fa 00 00
  0x502000006b00: fa fa 00 00 fa fa 00 00 fa fa 00 fa fa fa 00 fa
  0x502000006b80: fa fa 00 fa fa fa 00 fa fa fa 00 00 fa fa 00 00
  0x502000006c00: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa fd fa
=>0x502000006c80: fa fa fd fa fa fa fd fd fa fa fd[fd]fa fa fd fd
  0x502000006d00: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
  0x502000006d80: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
  0x502000006e00: fa fa 00 fa fa fa 00 fa fa fa 00 00 fa fa 00 fa
  0x502000006e80: fa fa 00 fa fa fa 00 00 fa fa 00 fa fa fa 00 fa
  0x502000006f00: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==4320==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants