<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58257>58257</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
mlir-reduce crashes with msg "Error running interestingness test: posix_spawn failed: Exec format error"
</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>
I was trying to use `mlir-reduce` to reduce my mlir file. The interestingness script is
```
mlir-opt --arith-expand $1
exit $?
```
With the reduced file `temp.mlir` and script `reduce.sh`, following the [official guidance](https://mlir.llvm.org/docs/Tools/mlir-reduce/#how-to-use-it), I tried cmd `mlir-reduce temp.mlir -reduction-tree='traversal-mode=0 test=reduce.sh' `, it crashed with following backtraceļ¼
```
LLVM ERROR: Error running interestingness test: posix_spawn failed: Exec format error
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: mlir-reduce temp.mlir "-reduction-tree=traversal-mode=0 test=reduce.sh"
#0 0x00000000016b4a33 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x16b4a33)
#1 0x00000000016b285e llvm::sys::RunSignalHandlers() (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x16b285e)
#2 0x00000000016b4eff SignalHandler(int) Signals.cpp:0:0
#3 0x00007f4d67ca30e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110e0)
#4 0x00007f4d667a4fff raise /build/glibc-77giwP/glibc-2.24/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f4d667a642a abort /build/glibc-77giwP/glibc-2.24/stdlib/abort.c:91:0
#6 0x000000000167d8a8 (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x167d8a8)
#7 0x00000000015d2710 mlir::controlFlowSink(llvm::ArrayRef<mlir::Region*>, mlir::DominanceInfo&, llvm::function_ref<bool (mlir::Operation*, mlir::Region*)>) (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x15d2710)
#8 0x00000000015d21df mlir::Tester::isInteresting(mlir::ModuleOp) const (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x15d21df)
#9 0x00000000015cf1c3 mlir::LogicalResult findOptimal<mlir::ReductionNode::iterator<(mlir::TraversalMode)0> >(mlir::ModuleOp, mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::Tester const&, bool) ReductionTreePass.cpp:0:0
#10 0x00000000015ce991 (anonymous namespace)::ReductionTreePass::runOnOperation() ReductionTreePass.cpp:0:0
#11 0x0000000001496428 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x1496428)
#12 0x0000000001496984 mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::unique_ptr<mlir::Pass, std::default_delete<mlir::Pass> >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x1496984)
#13 0x0000000001498958 mlir::PassManager::run(mlir::Operation*) (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x1498958)
#14 0x00000000014a92b6 mlir::mlirReduceMain(int, char**, mlir::MLIRContext&) (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x14a92b6)
#15 0x00000000007c025b main (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x7c025b)
#16 0x00007f4d667922e1 __libc_start_main /build/glibc-77giwP/glibc-2.24/csu/../csu/libc-start.c:325:0
#17 0x00000000007c00da _start (/data/cpp/mlir-fuzz/llvm-project-llvmorg-14.0.6/build/bin/mlir-reduce+0x7c00da)
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9WFtvozgU_jXkxQoiJtwe8pCmjbZSu43SavcxMmCId8FmbTNJ59fvsSEXmKw0s5pMlQaMzTnf-c7NTiryz8UzOhCFtPxkvERaoFZR5IReXTE5lTRvMwojM9ENUP2JzBwqWEVd9LGniHFNJVUaBHCqFFKZZI1GTCHHe3S8Jbzff-zQShawYDolkun9lB4bwnPk4PmsW0GPTJuh469vSui-_4R3kQb9HbDcIjLQNa0b12gxwI3kHhAMu6Wu2htZeIUKUVXiYC0HQU7wIIqCZYxUqGxZTjgYHzw6ON5r3SjHXzp4DR8j262qL7UrZAnjXGQKLh9CVKqfPlFn1vt7cZhqMQVmp0w7ODGan4FyBqCzOh_Rjc74UfdEM8GnWlLq-IAl0pJ8oVKRalqL3DwD7wD7cHOxDkeotxCYzCRRe1B1MIRdLE5J9jfIApBPa-dh5STLa3ZvUv7y8scretpu37bABXqSUkgkW86NuHEUdJiWqBGKHXeqIQeOCgIuyu27R5oBFlkTjaiR0ynYvDwt35-QatMagBOUtiW4txFSmwgceqEEc9rUzUQNA-ON_jJtpPiLZkD0minVUuMSGwaMZ1WbU-tqy8mFArdT_67hAcrbujFa7CMPppKNFKUkNSKybGvKtQGBbrvMwfhbr32Xy3CnECT4HvKO3ulvFqZz4vvImgiw_KX6VN3NRgLrFvSHdSSOL4skOeyEAgAEiAltKHATfCA_NjFLNIFL1jSniC3ar19HFE7NAGJ8Opu7ngtC1mnLqtxcGR9H-oN37KGaED_bMhvZguOA3rJl2_J3VnJS_Qa-qoAti_PecA2aAVw8pp4WBRoAA0A9k91j5RpU_tKz_2dBfi8oKu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