Issue 139270
Summary [MLIR] crashed on calling func `async_dispatch_fn()` with assertion violation: succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))
Labels mlir
Assignees
Reporter sweead
    test commit: [b0979b8](https://github.com/llvm/llvm-project/commit/b0979b8c65d76cc1897e97b9ad091d8d99abdd18)

step to reproduce:
```
mlir-opt test.mlir -int-range-optimizations
```

minimal test case:

[test.mlir.txt](https://github.com/user-attachments/files/20123480/test.mlir.txt)

Crash backtrace:
```
<unknown>:0: error: expected integer or index type
mlir-opt: /home/workdir/llvm-project/mlir/include/mlir/IR/StorageUniquerSupport.h:180: static ConcreteT mlir::detail::StorageUserBase<mlir::IntegerAttr, mlir::Attribute, mlir::detail::IntegerAttrStorage, mlir::detail::AttributeUniquer, mlir::TypedAttr::Trait>::get(MLIRContext *, Args &&...) [ConcreteT = mlir::IntegerAttr, BaseT = mlir::Attribute, StorageT = mlir::detail::IntegerAttrStorage, UniquerT = mlir::detail::AttributeUniquer, Traits = <mlir::TypedAttr::Trait>, Args = <mlir::Type &, const llvm::APInt &>]: Assertion `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: mlir-opt test.mlir -int-range-optimizations
 #0 0x0000565357625078 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/workdir/llvm-project/build/bin/mlir-opt+0x1355078)
 #1 0x0000565357622b9e llvm::sys::RunSignalHandlers() (/home/workdir/llvm-project/build/bin/mlir-opt+0x1352b9e)
 #2 0x0000565357625ad1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f97f3895520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f97f38e99fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007f97f3895476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007f97f387b7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007f97f387b71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007f97f388ce96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x000056535a99ecf0 mlir::IntegerAttr::getChecked(llvm::function_ref<mlir::InFlightDiagnostic ()>, mlir::Type, llvm::APInt const&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x46cecf0)
#10 0x000056535a99eb72 mlir::IntegerAttr::get(mlir::Type, llvm::APInt const&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x46ceb72)
#11 0x0000565357969e7c mlir::dataflow::maybeReplaceWithConstant(mlir::DataFlowSolver&, mlir::RewriterBase&, mlir::Value) (/home/workdir/llvm-project/build/bin/mlir-opt+0x1699e7c)
#12 0x0000565357970430 (anonymous namespace)::MaterializeKnownConstantValues::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const IntRangeOptimizations.cpp:0:0
#13 0x000056535d0f0332 void llvm::function_ref<void ()>::callback_fn<mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::$_0>(long) PatternApplicator.cpp:0:0
#14 0x000056535d0ed02f mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) (/home/workdir/llvm-project/build/bin/mlir-opt+0x6e1d02f)
#15 0x000056535a9346fa (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#16 0x000056535a930f53 mlir::applyPatternsGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x4660f53)
#17 0x0000565357973308 (anonymous namespace)::IntRangeOptimizationsPass::runOnOperation() IntRangeOptimizations.cpp:0:0
#18 0x000056535a8b52e3 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/workdir/llvm-project/build/bin/mlir-opt+0x45e52e3)
#19 0x000056535a8b5b82 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x45e5b82)
#20 0x000056535a8b835e mlir::PassManager::run(mlir::Operation*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x45e835e)
#21 0x000056535a8b08db performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#22 0x000056535a8b0534 llvm::LogicalResult llvm::function_ref<llvm::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&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#23 0x000056535a95d875 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/home/workdir/llvm-project/build/bin/mlir-opt+0x468d875)
#24 0x000056535a8a9722 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x45d9722)
#25 0x000056535a8a99d8 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x45d99d8)
#26 0x000056535a8a9bf2 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x45d9bf2)
#27 0x000056535760454f main (/home/workdir/llvm-project/build/bin/mlir-opt+0x133454f)
#28 0x00007f97f387cd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#29 0x00007f97f387ce40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#30 0x00005653576040a5 _start (/home/workdir/llvm-project/build/bin/mlir-opt+0x13340a5)
Aborted (core dumped)
```


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to