| Issue |
177955
|
| Summary |
mlir-opt crashes on affine.delinearize_index with ub.poison extents when running --convert-math-to-libm
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Subway2023
|
# Description
mlir-opt version: 22.1.0-rc1
mlir-opt crashes when running --convert-math-to-libm on a module containing affine.delinearize_index with ub.poison used as extents.
The crash is caused by an out-of-bounds access on a ValueRange (Index < size() assertion).
# Reproduce
location: If the **affine.delinearize_index** is commented out, the crash no longer occurs.
```
module {
func.func @main() {
%0 = ub.poison : index
%1 = smt.declare_fun : !smt.sort<"uninterpreted0">
%2 = gpu.global_id x
%3 = index.shru %2, %0
%4, %5, %6 = affine.delinearize_index %3 into (%0, %0) : index, index, index
return
}
}
```
```
mlir-opt --convert-math-to-libm test.mlir
```
```
mlir-opt: /mnt/sdd1/mlir/tool/llvm-project-llvmorg-21.1.2/llvm/include/llvm/ADT/STLExtras.h:1294: ReferenceT llvm::detail::indexed_accessor_range_base<DerivedT, BaseT, T, PointerT, ReferenceT>::operator[](size_t) const [with DerivedT = mlir::ValueRange; BaseT = llvm::PointerUnion<const mlir::Value*, mlir::OpOperand*, mlir::detail::OpResultImpl*>; T = mlir::Value; PointerT = mlir::Value; ReferenceT = mlir::Value; size_t = long unsigned int]: Assertion `Index < size() && "invalid index for value range"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /mnt/sdd1/mlir/tool/llvm-project-llvmorg-21.1.2/build/bin/mlir-opt --convert-math-to-libm /mnt/sdd1/mlir/data/genProgram_0124_night_filtered/genProgram_0124_night_valid/251527_dd37_6.mlir
#0 0x00005705d4af30d2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/mnt/sdd1/mlir/tool/llvm-project-llvmorg-21.1.2/build/bin/mlir-opt+0x1cae0d2)
#1 0x00005705d4aef83f llvm::sys::RunSignalHandlers() (/mnt/sdd1/mlir/tool/llvm-project-llvmorg-21.1.2/build/bin/mlir-opt+0x1caa83f)
#2 0x00005705d4aef98c SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x000075034bc45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x000075034bc9eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x000075034bc9eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x000075034bc9eb2c pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x000075034bc4527e raise ./signal/../sysdeps/posix/raise.c:27:6
#8 0x000075034bc288ff abort ./stdlib/abort.c:81:7
#9 0x000075034bc2881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x000075034bc3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs