[mlir] -test-func-insert-arg bug report
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
git version: 81a8c66fdc96a7bf6927bf3f88d4b2e24a5c71e7
system: `Ubuntu 18.04.6 LTS`
reproduce with: `mlir-opt -test-func-insert-arg a.mlir`
a.mlir:
```mlir
module {
func.func @f() attributes {test.insert_args = [[0, i1, {test.}], [1, i1, {test.}], [2, i1, {test.}]]} {
return
}
}
```
stack trace:
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -test-func-insert-arg 69.mlir
#0 0x000055a72dc1f0c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20360c8)
#1 0x000055a72dc1bf61 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2032f61)
#2 0x000055a72dc201e6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f210eed7420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x000055a736945165 mlir::TypeRange::dereference_iterator(llvm::PointerUnion const*, llvm::Repeated const*>, long) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad5c165)
#5 0x000055a7369466eb mlir::insertTypesInto(mlir::TypeRange, llvm::ArrayRef, mlir::TypeRange, llvm::SmallVectorImpl&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad5d6eb)
#6 0x000055a72e3ec77e mlir::FunctionOpInterface::getTypeWithArgsAndResults(llvm::ArrayRef, mlir::TypeRange, llvm::ArrayRef, mlir::TypeRange) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x280377e)
#7 0x000055a72e3ebff9 (anonymous namespace)::TestFuncInsertArg::runOnOperation() TestFunc.cpp:0:0
#8 0x000055a736607662 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xaa1e662)
#9 0x000055a7366084a4 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xaa1f4a4)
#10 0x000055a73660f3ba mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xaa263ba)
#11 0x000055a73660ecef mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xaa25cef)
#12 0x000055a72dcce3c0 performActions(llvm::raw_ostream&, std::shared_ptr const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#13 0x000055a72dccd5f6 llvm::LogicalResult llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#14 0x000055a73695ae55 mlir::splitAndProcessBuffer(std::unique_ptr>, llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad71e55)
#15 0x000055a72dcc4656 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20db656)
#16 0x000055a72dcc4a35 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20dba35)
#17 0x000055a72dcc4d95 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20dbd95)
#18 0x000055a72dc04b52 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x201bb52)
#19 0x00007f210e4f5083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#20 0x000055a72dc0468e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x201b68e)
Segmentation fault (core dumped)
```
Contributor guide
Research direction
Start by reproducing the crash with mlir-opt -test-func-insert-arg using the a.mlir input, then inspect the TestFunc.cpp entry point and the FunctionOpInterface::getTypeWithArgsAndResults stack frames. Done means this input no longer causes a segmentation fault, with regression coverage if the relevant test location is identified.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100