<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/116354>116354</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR]`-test-pass-crash` triggers crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
xisang0
</td>
</tr>
</table>
<pre>
Test on commit: https://github.com/llvm/lLvm-project/commit/6548b6354d1d990e1c98736f5e7c3de876bedc8e
steps to reproduce:
```
mlir-opt test.mlir -test-pass-crash
```
test case:
```
module {
func.func @main() -> () {
return
}
}
```
crash 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 /home/workdir/test.mlir -test-pass-crash
#0 0x000064fb01c443b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10723b8)
#1 0x000064fb01c41ede llvm::sys::RunSignalHandlers() (./mlir-opt+0x106fede)
#2 0x000064fb01c44dc8 SignalHandler(int) Signals.cpp:0:0
#3 0x00007e601e45b520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007e601e4af9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007e601e45b476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007e601e4417f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000064fb04dbc856 (./mlir-opt+0x41ea856)
#8 0x000064fb04ec06df mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x42ee6df)
#9 0x000064fb04ec0ec2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x42eeec2)
#10 0x000064fb04ec366e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x42f166e)
#11 0x000064fb04ebc192 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#12 0x000064fb04ebbdfb llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#13 0x000064fb04f65ae5 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (./mlir-opt+0x4393ae5)
#14 0x000064fb04eb6ff2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x42e4ff2)
#15 0x000064fb04eb72a3 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x42e52a3)
#16 0x000064fb04eb74b2 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x42e54b2)
#17 0x000064fb01c235d7 main (./mlir-opt+0x10515d7)
#18 0x00007e601e442d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#19 0x00007e601e442e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#20 0x000064fb01c23145 _start (./mlir-opt+0x1051145)
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWN1u2zoSfhr6hohBURQlXfjCTWpsgQYNkt4bFDmSuaVJLUn1JG-_oOTElhO3xwf7g93CjSVxfr5vZjj0SISgOwuwQsUnVNwtxBB3zq-edRC2I4vGqZfVdwgRO4ul2-91RPka72LsA8rXiG4Q3XQ67oZmKd0e0Y0xP8evrz_3N713fwcZEd0cVOmGF6xqeF4wlam6JpDJuipz3hZQylxBVfIGlKwAkTtE1iFCH3B02EPvnRokJKfjEuLk8Blv90b7G9dHHCHEZbrDN-nyphch3Egvwu5DvSSDpQiXDTs1GMCo_DTdY9wOVi7TH4wY2QttEa0QrfENyj_jw_WJOMYe4uDt4R6Vdwc_bxdzhyNWHL24TPbh6-f102cchmavIxa4GboUIedjitWfSI6ZJUeHMEBAdIOFVVhbaQYFOO4AT1gaIX-MeJaT-6co5A-shn3_BpAs8fjvwbvOiz0Wvhv2YGPCgZeIbt7yg-hm5_aA6OYP538o7RHd_C5nGNGcYPJMCCGctQ3JJGN5U-GRT75G-Tq8hOniwWsbR4TfxxDS6ijkxR9bF6IHsUeUI3qLtY1jumh1ChLRT-Q5IyXNm5TNI4jsDEQGCj4C8TjYJ91ZYf4mrDLgw2tZfOiHt6Bg5oeek1WywjOLiFYH7NPjsJR9SgcZ_78Zyg-GSuAkA1Y0BSVTjW6MbhDdPFd8y9mN0XZ4vunsMC3IZXBLPsJjtKBkBo7NbYq2biXu486DUNsf2pjrHNS8buXMQXEOmpUcd2HkeS14VvKZbT63zbKyzbFo0ta5yjKtyjafWS5Pc8ZUI6uCf5hwloGoijmsaqYMknDV4qQ11ZOCKLSZrr_13923_kGEsFaij-4g4ofUh44qSQDRdSry48NvPXgRtbPvVtZWmJegw72wokvldYsb50z6Hux4RK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