llvm / llvm/llvm-project

[mlir](sparse-tensor-codegen) mlir-opt triggers segmentation fault with sparse-tensor-codegen

Open
#211,187 3 comments 0 reactions 1 assignee Claimed by @akparmar004 View on GitHub
crash mlir
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

git version: e8b66ff170f99c6cf275444f22a3aded65ef0bc1

MLIR Program:
```mlir
#sparse = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed), posWidth = 64, crdWidth = 64 }>
module {
llvm.func @m(%arg0: f64) -> () {
%cst = arith.constant 0.000000e+00 : f64
%c0 = arith.constant 0 : index
%5 = bufferization.alloc_tensor() : tensor<128x64xf64, #sparse>
%inserted = tensor.insert %cst into %5[%c0, %c0] : tensor<128x64xf64, #sparse>
llvm.return
}
}
```

Reproduce Command: `mlir-opt --sparse-tensor-codegen a.mlir`

StackTrace:
```
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: mlir-opt --sparse-tensor-codegen a.mlir
#0 0x0000564e06522d7f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1fa8d7f)
#1 0x0000564e0651f51c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1fa551c)
#2 0x0000564e0651f6c3 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f1ff1de6420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x0000564e07380b5b mlir::sparse_tensor::FuncCallOrInlineGenerator<(anonymous namespace)::SparseInsertGenerator>::genCallOrInline(mlir::OpBuilder&, mlir::Location) (.constprop.0) SparseTensorCodegen.cpp:0:0
#5 0x0000564e0738138a (anonymous namespace)::SparseInsertConverter::matchAndRewrite(mlir::tensor::InsertOp, mlir::tensor::InsertOpGenericAdaptor>, mlir::ConversionPatternRewriter&) const SparseTensorCodegen.cpp:0:0
#6 0x0000564e07372d21 mlir::OpConversionPattern::matchAndRewrite(mlir::Operation*, llvm::ArrayRef, mlir::ConversionPatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2df8d21)
#7 0x0000564e0f492f08 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf18f08)
#8 0x0000564e0f4d9f42 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref, llvm::function_ref, llvm::function_ref)::'lambda'()::operator()() const PatternApplicator.cpp:0:0
#9 0x0000564e0f4db4a8 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref, llvm::function_ref, llvm::function_ref) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf614a8)
#10 0x0000564e0f48da4b (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*) DialectConversion.cpp:0:0
#11 0x0000564e0f48df36 mlir::OperationConverter::convert(mlir::Operation*, bool) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf13f36)
#12 0x0000564e0f498f0a mlir::OperationConverter::applyConversion(llvm::ArrayRef) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf1ef0a)
#13 0x0000564e0f49a7c8 applyConversion(llvm::ArrayRef, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode) DialectConversion.cpp:0:0
#14 0x0000564e0f49a9a6 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf209a6)
#15 0x0000564e072d81e5 (anonymous namespace)::SparseTensorCodegenPass::runOnOperation() SparseTensorPasses.cpp:0:0
#16 0x0000564e0f545ac1 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xafcbac1)
#17 0x0000564e0f545e50 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xafcbe50)
#18 0x0000564e0f547f04 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xafcdf04)
#19 0x0000564e0f548f81 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xafcef81)
#20 0x0000564e065e8b9b performActions(llvm::raw_ostream&, std::shared_ptr const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#21 0x0000564e065e96df processBuffer(llvm::raw_ostream&, std::unique_ptr>, llvm::MemoryBufferRef, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, mlir::SourceMgrDiagnosticVerifierHandler*, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#22 0x0000564e065e990b llvm::LogicalResult llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr>, llvm::MemoryBufferRef, llvm::raw_ostream&)>(long, std::unique_ptr>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#23 0x0000564e0f915c45 mlir::splitAndProcessBuffer(std::unique_ptr>, llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb39bc45)
#24 0x0000564e065df954 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (.part.0) MlirOptMain.cpp:0:0
#25 0x0000564e065e9e27 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x206fe27)
#26 0x0000564e065ea063 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2070063)
#27 0x0000564e0646794c main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1eed94c)
#28 0x00007f1ff18b2083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#29 0x0000564e064ff34e _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1f8534e)
Segmentation fault (core dumped)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.