Skip to content

[mlir] Convert-linalg-to-std Pass trigger 'llvm::install_out_of_memory_new_handler()' and crash #59986

@Colloportus0

Description

@Colloportus0

MLIR built at commit a0138390
Reproduced with:
mlir-opt --convert-linalg-to-std temp.mlir

temp.mlir:

  func.func @func(%arg0: tensor<4x8xf32>, %arg1: tensor<4x8xf32>) -> tensor<4x8xf32> {
    %0 = linalg.copy ins(%arg0 : tensor<4x8xf32>) outs(%arg1 : tensor<4x8xf32>) -> tensor<4x8xf32>
    return %0 : tensor<4x8xf32>
  }

trace:

Invalid type for linalg library name mangling
UNREACHABLE executed at /Users/haoyu/workspace/mlir-fuzz/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1814!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: mlir-opt --convert-linalg-to-std temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt                 0x0000000104dcc5bc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x0000000104dcb624 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt                 0x0000000104dccc54 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001a56894c4 _sigtramp + 56
4  libsystem_pthread.dylib  0x00000001a5671ee0 pthread_kill + 288
5  libsystem_c.dylib        0x00000001a55ac340 abort + 168
6  mlir-opt                 0x0000000104d93504 llvm::install_out_of_memory_new_handler() + 0
7  mlir-opt                 0x0000000105106ff0 (anonymous namespace)::EraseDeadLinalgOp::~EraseDeadLinalgOp() + 0
8  mlir-opt                 0x00000001050a6bbc mlir::linalg::generateLibraryCallName(mlir::Operation*) + 620
9  mlir-opt                 0x000000010515799c mlir::linalg::detail::LinalgOpInterfaceTraits::Model<mlir::linalg::CopyOp>::getLibraryCallName(mlir::linalg::detail::LinalgOpInterfaceTraits::Concept const*, mlir::Operation*) + 52
10 mlir-opt                 0x0000000105c2097c mlir::linalg::LinalgOpToLibraryCallRewrite::matchAndRewrite(mlir::linalg::LinalgOp, mlir::PatternRewriter&) const + 112
11 mlir-opt                 0x000000010626bbd0 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1440
12 mlir-opt                 0x00000001060194b0 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) + 1948
13 mlir-opt                 0x0000000106012b1c (anonymous namespace)::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>, llvm::function_ref<void (mlir::Diagnostic&)>) + 928
14 mlir-opt                 0x0000000106014db8 mlir::applyFullConversion(mlir::Operation*, mlir::ConversionTarget&, mlir::FrozenRewritePatternSet const&) + 80
15 mlir-opt                 0x0000000105c22110 (anonymous namespace)::ConvertLinalgToStandardPass::runOnOperation() + 556
16 mlir-opt                 0x0000000105fd74dc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 420
17 mlir-opt                 0x0000000105fd7a0c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
18 mlir-opt                 0x0000000105fd9388 mlir::PassManager::run(mlir::Operation*) + 1148
19 mlir-opt                 0x0000000105fd2840 performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 504
20 mlir-opt                 0x0000000105fd2410 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
21 mlir-opt                 0x000000010603d02c mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
22 mlir-opt                 0x0000000105fd0838 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
23 mlir-opt                 0x0000000105fd0d2c mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
24 mlir-opt                 0x0000000104c6f0a0 main + 108
25 dyld                     0x00000001097ad088 start + 516

Metadata

Metadata

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]mlir:linalg

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions