llvm / llvm/llvm-project

[mlir] Assertion `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))' failed.

Open
#206,919 1 comment 0 reactions 0 assignees View on GitHub
crash mlir
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

git version: 9e0aa61f75299f91b9e063ba46d2e33aa164cf7a

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -test-one-shot-module-bufferize a.mlir`

a.mlir:

```mlir
module {
func.func private @sparse_csr(tensor) -> tensor>
}

```

stack trace:

```
Running TestOneShotModuleBufferize on: builtin.module
:0: error: invalid memref element type
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/mlir/include/mlir/IR/StorageUniquerSupport.h:180: static ConcreteT mlir::detail::StorageUserBase::get(MLIRContext *, Args &&...) [ConcreteT = mlir::MemRefType, BaseT = mlir::BaseMemRefType, StorageT = mlir::detail::MemRefTypeStorage, UniquerT = mlir::detail::TypeUniquer, Traits = , Args = &, mlir::Type &, mlir::MemRefLayoutAttrInterface &, mlir::Attribute &>]: Assertion `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -test-one-shot-module-bufferize 96.mlir
#0 0x000055f49b63a7bb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x200d7bb)
#1 0x000055f49b637621 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x200a621)
#2 0x000055f49b63b8e6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f5fc81b3420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f5fc77f000b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f5fc77cf859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f5fc77cf729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f5fc77cf729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f5fc77e0fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x000055f4a4668797 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xb03b797)
#10 0x000055f4a4668680 mlir::MemRefType::get(llvm::ArrayRef, mlir::Type, mlir::MemRefLayoutAttrInterface, mlir::Attribute) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xb03b680)
#11 0x000055f49b70d6a3 std::_Function_handler::_M_invoke(std::_Any_data const&, mlir::bufferization::TensorLikeType&&, mlir::Attribute&&, mlir::bufferization::BufferizationOptions const&) TestOneShotModuleBufferize.cpp:0:0
#12 0x000055f49b70d4d9 std::_Function_handler::_M_invoke(std::_Any_data const&, mlir::bufferization::TensorLikeType&&, mlir::Attribute&&, mlir::func::FuncOp&&, mlir::bufferization::BufferizationOptions const&) TestOneShotModuleBufferize.cpp:0:0
#13 0x000055f4a29091ac mlir::bufferization::func_ext::FuncOpInterface::bufferize(mlir::Operation*, mlir::RewriterBase&, mlir::bufferization::BufferizationOptions const&, mlir::bufferization::BufferizationState&) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x92dc1ac)
#14 0x000055f4a28e967c mlir::bufferization::bufferizeOp(mlir::Operation*, mlir::bufferization::BufferizationOptions const&, mlir::bufferization::BufferizationState&, mlir::bufferization::BufferizationStatistics*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x92bc67c)
#15 0x000055f4a2920945 mlir::bufferization::bufferizeModuleOp(mlir::Operation*, mlir::bufferization::OneShotBufferizationOptions const&, mlir::bufferization::BufferizationState&, mlir::bufferization::BufferizationStatistics*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x92f3945)
#16 0x000055f4a2921800 mlir::bufferization::runOneShotModuleBufferize(mlir::Operation*, mlir::bufferization::OneShotBufferizationOptions const&, mlir::bufferization::BufferizationState&, mlir::bufferization::BufferizationStatistics*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x92f4800)
#17 0x000055f49b70d12d (anonymous namespace)::TestOneShotModuleBufferizePass::runOnOperation() TestOneShotModuleBufferize.cpp:0:0
#18 0x000055f4a43bad58 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad8dd58)
#19 0x000055f4a43bbd34 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad8ed34)
#20 0x000055f4a43c2dba mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad95dba)
#21 0x000055f4a43c267f mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad9567f)
#22 0x000055f49b6e97f0 performActions(llvm::raw_ostream&, std::shared_ptr const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x000055f49b6e8a26 llvm::LogicalResult llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#24 0x000055f4a4722cd6 mlir::splitAndProcessBuffer(std::unique_ptr>, llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xb0f5cd6)
#25 0x000055f49b6dfb76 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b2b76)
#26 0x000055f49b6dff5a mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b2f5a)
#27 0x000055f49b6e02b5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b32b5)
#28 0x000055f49b6200c2 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff30c2)
#29 0x00007f5fc77d1083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#30 0x000055f49b61fbfe _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff2bfe)
Aborted (core dumped)
```

Contributor guide

Open the contributing guide

Research direction

Start by running `mlir-opt -test-one-shot-module-bufferize a.mlir` with the reproducer in the issue and inspect `TestOneShotModuleBufferize.cpp`, where the stack enters `MemRefType::get`. Trace the bufferization of the private function returning `tensor>`; done means this input no longer aborts on the invalid memref element type and has a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.