8000 Use of invalid iterator in `iree-codegen-propagate-reshapes-by-expansion` · Issue #20736 · iree-org/iree · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use of invalid iterator in iree-codegen-propagate-reshapes-by-expansion #20736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rkayaith opened this issue May 6, 2025 · 0 comments · Fixed by #20740
Closed

Use of invalid iterator in iree-codegen-propagate-reshapes-by-expansion #20736

rkayaith opened this issue May 6, 2025 · 0 comments · Fixed by #20740
Assignees
Labels
bug 🐞 Something isn't working

Comments

@rkayaith
Copy link
Member
rkayaith commented May 6, 2025

What happened?

iree-opt: /home/rkayaith/repos/iree/third_party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:780: llvm::SmallVectorImpl::iterator llvm::SmallVectorImpl<long>::insert_one_impl(llvm::SmallVectorImpl::iterator, ArgType &&) [T = long, ArgType = long]: Assertion `this->isReferenceToStorage(I) && "Insertion iterator is out of bounds."' failed.
Please report issues to https://github.com/iree-org/iree/issues and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/rkayaith/repos/iree/build/compiler/build/i/python_packages/iree_compiler/iree/compiler/tools/../_mlir_libs/iree-opt iter-repro.mlir --run-reproducer
 #0 0x000071f862216647 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/rkayaith/repos/iree/third_party/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:13
 #1 0x000071f862214880 llvm::sys::RunSignalHandlers() /home/rkayaith/repos/iree/third_party/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x000071f862216d05 SignalHandler(int, siginfo_t*, void*) /home/rkayaith/repos/iree/third_party/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
 #3 0x000071f85b442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000071f85b4969fc __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
 #5 0x000071f85b4969fc __pthread_kill_internal ./nptl/./nptl/pthread_kill.c:78:10
 #6 0x000071f85b4969fc pthread_kill ./nptl/./nptl/pthread_kill.c:89:10
 #7 0x000071f85b442476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x000071f85b4287f3 abort ./stdlib/./stdlib/abort.c:81:7
 #9 0x000071f85b42871b _nl_load_domain ./intl/./intl/loadmsgcat.c:1177:9
#10 0x000071f85b439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x000071f8622430a9 (/home/rkayaith/repos/iree/build/compiler/bindings/python/iree/compiler/_mlir_libs/libIREECompiler.so+0x6a430a9)
#12 0x000071f864699d80 llvm::SmallVectorBase<unsigned int>::size() const /home/rkayaith/repos/iree/third_party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:78:32
#13 0x000071f864699d80 llvm::SmallVectorTemplateCommon<long, void>::end() /home/rkayaith/repos/iree/third_party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:269:37
#14 0x000071f864699d80 mlir::iree_compiler::(anonymous namespace)::getExpandedShape(llvm::SmallVector<llvm::SmallVector<long, 2u>, 1u>, llvm::ArrayRef<long>, mlir::Value, llvm::SmallVectorImpl<long>&, llvm::SmallVectorImpl<long>&) /home/rkayaith/repos/iree/compiler/src/iree/compiler/Codegen/Common/PropagateReshapesByExpansion.cpp:67:36
#15 0x000071f864699d80 mlir::iree_compiler::(anonymous namespace)::ExpandDestinationForallOp::matchAndRewrite(mlir::tensor::ParallelInsertSliceOp, mlir::PatternRewriter&) const /home/rkayaith/repos/iree/compiler/src/iree/compiler/Codegen/Common/PropagateReshapesByExpansion.cpp:233:16

Steps to reproduce your issue

Repro IR: https://gist.github.com/rkayaith/0f438421fcaab341b45751b777ede023

iree-opt iter-repro.mlir --run-reproducer

What component(s) does this issue relate to?

Compiler

Version information

0713e70

Additional context

No response

@rkayaith rkayaith added the bug 🐞 Something isn't working label May 6, 2025
@rkayaith rkayaith self-assigned this May 6, 2025
rkayaith added a commit that referenced this issue May 6, 2025
…on` (#20740)

The previous code held iterators to a vector across insertions, which
leads to a crash once the vector needs to be reallocated. This is
resolved by holding indexes instead of iterators.

fixes #20736
KyleHerndon pushed a commit to KyleHerndon/iree that referenced this issue May 7, 2025
…on` (iree-org#20740)

The previous code held iterators to a vector across insertions, which
leads to a crash once the vector needs to be reallocated. This is
resolved by holding indexes instead of iterators.

fixes iree-org#20736
rkayaith added a commit to rkayaith/iree that referenced this issue May 7, 2025
rkayaith added a commit that referenced this issue May 8, 2025
Check in minimized failing IR from #20736
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
< 3F1B !-- '"` -->
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0