<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60209>60209</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Test-transform-dialect-interpreter crashed with segmentation fault
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Colloportus0
      </td>
    </tr>
</table>

<pre>
    MLIR built at commit https://github.com/llvm/llvm-project/commit/a0dab495
Reproduced with: 
`mlir-opt --test-transform-dialect-interpreter temp.mlir`

temp.mlir:
``` milr 
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:
```console 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

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWEtv47oV_jX0hohBUQ9LCy88eeAGiBEjCVq0G4OSjmT2UqRKUpnr_vqCelpOfMczncW0aDAYKeF5fOd9RGYMLyXAGoVfUHi3YI09KL2-VUKoWmnbGLJIVX5cb58eX3DacGExszhTVcUtPlhbG-RvEH1A9KHk9tCky0xViD4I8T48bmqt_gGZRfSh40P0gZGcpUESInKHyOYFaq3yJoMcf-X2gPwN7g5QRCrB9Y2qLb65sWDsjdVMmkLp6ibnTEBmb7i0oGsNFjS2UNVLx4Ii0oto_5_-7m9G0d0_XHGhe32j8KXDsa9zsa-ZtaClwWj1pecM79OUIBojGjJdkhYu9epcLFUNmlmuJKLJqAljd9TLwSggTqxlugSLHW8KEgrnldhDNJn0YIxxp8Jg5N_hVrjMzexUg2mE7QjssYb5KbNWt0fuhaeNhdkxmeQ60BhRKrhkolxWzFaNQJSOZhp8YqdmsgTk374z0QDy7wfclLoYLZ22DaK0Fd_DQKu7G-Tf407gBPuDTGfFIHIEq-Gr5hY60C42DusUrT4VHN6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