[mlir] -test-alias-analysis-modref bug report
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
git version: 9e0aa61f75299f91b9e063ba46d2e33aa164cf7a
system: `Ubuntu 18.04.6 LTS`
reproduce with: `mlir-opt -test-alias-analysis-modref a.mlir`
a.mlir:
```mlir
module {
func.func @f(%arg0: f32 {test._ptr}) attributes {test.ptr} {
%0 = "test.ptr"(%arg0) {test._ptr} : (f32) -> f32
%1 = "test.ptr"(%arg0) {test.inclusive} : (f32) -> f32
%2 = "test.ptr"(%arg0) {test.exclusive} : (f32) -> f32
%3 = "test.ptr"(%arg0) {test.c_ptr} : (f32) -> f32
return
}
}
```
stack trace:
```
Testing : <>
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-alias-analysis-modref 100.mlir
#0 0x00005613c764a7bb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x200d7bb)
#1 0x00005613c7647621 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x200a621)
#2 0x00005613c764b8e6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007fa3ecfe9420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00005613d0636ed3 mlir::StringAttr::getValue() const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xaff9ed3)
#5 0x00005613c775880b printAliasOperand(mlir::Operation*) TestAliasAnalysis.cpp:0:0
#6 0x00005613c77586d4 mlir::test::printModRefResult(mlir::ModRefResult, mlir::Operation*, mlir::Value) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x211b6d4)
#7 0x00005613c770c1ae void mlir::detail::walk(mlir::Operation*, llvm::function_ref, mlir::WalkOrder) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20cf1ae)
#8 0x00005613c7758c4d mlir::test::TestAliasAnalysisModRefBase::runAliasAnalysisOnOperation(mlir::Operation*, mlir::AliasAnalysis&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x211bc4d)
#9 0x00005613c7759c52 (anonymous namespace)::TestAliasAnalysisModRefPass::runOnOperation() TestAliasAnalysis.cpp:0:0
#10 0x00005613d03cad58 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad8dd58)
#11 0x00005613d03cbd34 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+0xad8ed34)
#12 0x00005613d03d2dba mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad95dba)
#13 0x00005613d03d267f mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xad9567f)
#14 0x00005613c76f97f0 performActions(llvm::raw_ostream&, std::shared_ptr const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#15 0x00005613c76f8a26 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
#16 0x00005613d0732cd6 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+0xb0f5cd6)
#17 0x00005613c76efb76 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b2b76)
#18 0x00005613c76eff5a mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b2f5a)
#19 0x00005613c76f02b5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20b32b5)
#20 0x00005613c76300c2 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff30c2)
#21 0x00007fa3ec607083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#22 0x00005613c762fbfe _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1ff2bfe)
Segmentation fault (core dumped)
```
Contributor guide
Research direction
Reproduce the crash with mlir-opt -test-alias-analysis-modref using the provided a.mlir input. Start in TestAliasAnalysis.cpp, especially printAliasOperand and the call path from runAliasAnalysisOnOperation. Done means the command no longer segfaults and the alias-analysis output handles the supplied attributes correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100