<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61282>61282</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR]`mlir::ForwardIterator::makeIterable` crashed with segmentation fault.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
BealZephyr
</td>
</tr>
</table>
<pre>
Test on commit: https://github.com/llvm/llvm-project/commit/22c0ce96912f55f48ba4535800bacc0c48fe9832
Steps to reproduce:
```
mlir-opt test.mlir -affine-data-copy-generate="generate-dma=false fast-mem-space=0 skip-non-unit-stride-loops"
```
test case:
```
module {
func.func @main() {
%true = spirv.Constant true
%alloc = memref.alloc() {alignment = 64 : i64} : memref<i1>
affine.store %true, %alloc[] : memref<i1>
return
}
}
```
crash traces:
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt test.mlir "-affine-data-copy-generate=generate-dma=false fast-mem-space=0 skip-non-unit-stride-loops"
#0 0x0000560b41a78aaa llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x221aaa)
#1 0x0000560b41a75fac SignalHandler(int) Signals.cpp:0:0
#2 0x00007efc43140980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#3 0x0000560b434d19c0 mlir::ForwardIterator::makeIterable(mlir::Operation&) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1c7a9c0)
#4 0x0000560b41b15b24 (anonymous namespace)::AffineDataCopyGeneration::runOnOperation() AffineDataCopyGeneration.cpp:0:0
#5 0x0000560b43322e59 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1acbe59)
#6 0x0000560b4332317a mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1acc17a)
#7 0x0000560b433234f8 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::'lambda'(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&)::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#8 0x0000560b43322635 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1acb635)
#9 0x0000560b43322dca mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1acbdca)
#10 0x0000560b43323cb3 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (.constprop.495) Pass.cpp:0:0
#11 0x0000560b4332439d mlir::PassManager::run(mlir::Operation*) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1acd39d)
#12 0x0000560b433173a3 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#13 0x0000560b43317ad9 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPool*) MlirOptMain.cpp:0:0
#14 0x0000560b43317e01 mlir::LogicalResult llvm::function_ref<mlir::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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#15 0x0000560b433dc9b0 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1b859b0)
#16 0x0000560b43314ae3 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1abdae3)
#17 0x0000560b433181e8 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1ac11e8)
#18 0x0000560b41a44ec0 main (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x1edec0)
#19 0x00007efc4221bc87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#20 0x0000560b41a57b5a _start (llvm-project-22c0ce96912f55f48ba4535800bacc0c48fe9832/build/bin/mlir-opt+0x200b5a)
Segmentation fault (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWV2T2yrS_jX4hrIKgWRLF77wjOP3zVamMpVJ7cW5cbUQktkg0AI6Gf_7LSR_yfHkzGyNs-dsbcoZCdFA99NPtxoEzslaC7FA6R1KVxPo_NbYxZ0A9Ztotzs7KUy5W3wVzmOjMTdNIz1iS7z1vnWILRFdI7qupd92RcRNg-haqd8Pl2lrzT8E94iu90PpmlJOuMhneUyrNK2SrIAkZWlGSAGcE55klcgzRhFZIbJ88qJ12BtsRWtN2XERFu270Izsf32zUdJOTeuxF85HoYWnUFVSi2kJHqbctLtpLbSw4AViK0TpoTUtG0BsVYFyAlfg_LQRzdS1EFZbEey-yXaqjZ52Wvqp81aWYqqMaR2i9KoyQQfMwb2srSk7JTCa3w1tXHWaR-EPRglpQGpEM0RzfCaCMUY09bYTGLEVdq20v0f3RjsP2uPwfCQIShneSzaisaKK-gf7adH8DpSsdSO072VmCQ5-lbMEzVf97TAKsXsZI_bhNPUAauS8seKgEKL3xyUHKv10Cit8Z_WhjearPUbHmzFY3ILbYm-BC_cSoI-fPiyfPmDXFY30GHDR1YEzxvrAnjfTVTrXCYfoGoMusdRcdaXAfivwoEwB_FuvUHTgKfBvuOya9qggiXD_79Ga2kKDwdZdgDvogc-Xm746JOi66KQqwzUQZH2F84jSn9L-HTmPEWUEk2dCCElnpEhimGcA0BsXYGBLt3PDzaOV2vcgfQ2oIZqdhCx83xjnrYAG0VmgktS-J-kg9X44IXpHnimNAQDR_GRFfGFFWgHHT7LWoP4fdKmERTTbKzU8dhFvg6tJ__84Ed1PNBcVT1ickDwjeLOxoo-WjfW4j7-1kgWi6-dstpklUyV19zytdTd0tH5rBZSRMxHpF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