llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mlir] `transform::WithPDLPatternsOp::apply` crashed with segmentation fault

Open Colloportus0 opened this issue 3 years ago • 2 comments

MLIR built at commit https://github.com/llvm/llvm-project/commit/a0dab495 Reproduced with:

mlir-opt --test-transform-dialect-interpreter temp.mlir

temp.mlir:

transform.with_pdl_patterns {
^bb0(%arg0: !pdl.operation):
  pdl.pattern @pdl_target : benefit(1) {
    %args = operands
    %results = types
    %attr = attribute
    %0 = operation "linalg.matmul"(%args : !pdl.range<value>) {"test.attrA" = %attr}-> (%results : !pdl.range<type>) 
    rewrite %0 with "transform.dialect"
  }
}

trace:

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 --test-transform-dialect-interpreter 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                 0x00000001025706b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x000000010256f720 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt                 0x0000000102570d50 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001aad414c4 _sigtramp + 56
4  mlir-opt                 0x000000010355e85c mlir::transform::WithPDLPatternsOp::apply(mlir::transform::TransformResults&, mlir::transform::TransformState&) + 652
5  mlir-opt                 0x000000010355e85c mlir::transform::WithPDLPatternsOp::apply(mlir::transform::TransformResults&, mlir::transform::TransformState&) + 652
6  mlir-opt                 0x0000000103546624 mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::WithPDLPatternsOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformResults&, mlir::transform::TransformState&) + 72
7  mlir-opt                 0x000000010354a1f4 mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) + 1232
8  mlir-opt                 0x000000010354cef0 mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::transform::TransformOptions const&) + 148
9  mlir-opt                 0x0000000103bb1d60 (anonymous namespace)::TestTransformDialectInterpreterPass::runOnOperation() + 256
10 mlir-opt                 0x0000000103bec428 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
11 mlir-opt                 0x0000000103bec958 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
12 mlir-opt                 0x0000000103bee2d4 mlir::PassManager::run(mlir::Operation*) + 1148
13 mlir-opt                 0x0000000103be7698 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
14 mlir-opt                 0x0000000103be7268 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
15 mlir-opt                 0x0000000103c51f5c 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
16 mlir-opt                 0x0000000103be5690 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
17 mlir-opt                 0x0000000103be5b84 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
18 mlir-opt                 0x0000000102412ae4 main + 108
19 dyld                     0x0000000107631088 start + 516

Colloportus0 avatar Jan 22 '23 16:01 Colloportus0

@llvm/issue-subscribers-mlir

llvmbot avatar Jan 22 '23 16:01 llvmbot

working at https://reviews.llvm.org/D143474

sott0n avatar Feb 09 '23 05:02 sott0n