Issue 128308
Summary [MLIR]`-test-bytecode-roundtrip=test-kind=2` triggers Assertion Failure `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))'
Labels mlir
Assignees
Reporter xisang0
    Test on commit: https://github.com/llvm/llvm-project/commit/47928ab16b675c17826ada16f23aa0569e93a474
steps to reproduce:
```
mlir-opt test.mlir -test-bytecode-roundtrip=test-kind=2
```
test case:
```
module {
 func.func @main() -> () {
    %cst = arith.constant dense<42> : vector<3xi32>
    return
  }
}
```
crash trace:
```
Overriding parsing of TestI32Type encoding...
<unknown>:0: error: failed to verify 'elementType': integer or index or floating-point
<unknown>:0: note: in bytecode version 6 produced by: MLIR20.0.0git
mlir-opt: /home/workdir/llvm-project-19/mlir/include/mlir/IR/StorageUniquerSupport.h:180: static ConcreteT mlir::detail::StorageUserBase<mlir::VectorType, mlir::Type, mlir::detail::VectorTypeStorage, mlir::detail::TypeUniquer, mlir::ShapedType::Trait, mlir::ValueSemantics>::get(MLIRContext *, Args &&...) [ConcreteT = mlir::VectorType, BaseT = mlir::Type, StorageT = mlir::detail::VectorTypeStorage, UniquerT = mlir::detail::TypeUniquer, Traits = <mlir::ShapedType::Trait, mlir::ValueSemantics>, Args = <llvm::ArrayRef<long> &, mlir::Type &, llvm::ArrayRef<bool> &>]: 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 /home/workdir/test.mlir -test-bytecode-roundtrip=test-kind=2
 #0 0x000061cc539e59b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x107f9b8)
 #1 0x000061cc539e34de llvm::sys::RunSignalHandlers() (./mlir-opt+0x107d4de)
 #2 0x000061cc539e63c8 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007a32b865d520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007a32b86b19fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007a32b865d476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007a32b86437f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007a32b864371b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007a32b8654e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x000061cc56dc8b3c (./mlir-opt+0x4462b3c)
#10 0x000061cc56dc89a8 mlir::VectorType::get(llvm::ArrayRef<long>, mlir::Type, llvm::ArrayRef<bool>) (./mlir-opt+0x44629a8)
#11 0x000061cc56dc4fef (anonymous namespace)::BuiltinDialectBytecodeInterface::readType(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#12 0x000061cc56b6e605 std::unique_ptr<mlir::AttrTypeBytecodeReader<mlir::Type>, std::default_delete<mlir::AttrTypeBytecodeReader<mlir::Type>>> mlir::AttrTypeBytecodeReader<mlir::Type>::fromCallable<(anonymous namespace)::TestBytecodeRoundtripPass::runTest2(mlir::Operation*)::'lambda'(mlir::DialectBytecodeReader&, llvm::StringRef, mlir::Type&), true>((anonymous namespace)::TestBytecodeRoundtripPass::runTest2(mlir::Operation*)::'lambda'(mlir::DialectBytecodeReader&, llvm::StringRef, mlir::Type&)&&)::Processor::read(mlir::DialectBytecodeReader&, llvm::StringRef, mlir::Type&) TestBytecodeRoundtrip.cpp:0:0
#13 0x000061cc58d5ae01 (anonymous namespace)::AttrTypeReader::resolveType(unsigned long) BytecodeReader.cpp:0:0
#14 0x000061cc58d59ad7 (anonymous namespace)::DialectReader::readType(mlir::Type&) BytecodeReader.cpp:0:0
#15 0x000061cc56dc6864 llvm::LogicalResult mlir::DialectBytecodeReader::readType<mlir::ShapedType>(mlir::ShapedType&) (./mlir-opt+0x4460864)
#16 0x000061cc56dc3f8b (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#17 0x000061cc58d5a6a4 (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#18 0x000061cc58d59a37 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#19 0x000061cc53c20c74 llvm::LogicalResult mlir::DialectBytecodeReader::readAttribute<mlir::TypedAttr>(mlir::TypedAttr&) (./mlir-opt+0x12bac74)
#20 0x000061cc53c20c18 mlir::arith::ConstantOp::readProperties(mlir::DialectBytecodeReader&, mlir::OperationState&) (./mlir-opt+0x12bac18)
#21 0x000061cc58d57388 mlir::BytecodeReader::Impl::parseRegions(std::vector<mlir::BytecodeReader::Impl::RegionReadState, std::allocator<mlir::BytecodeReader::Impl::RegionReadState>>&, mlir::BytecodeReader::Impl::RegionReadState&) (./mlir-opt+0x63f1388)
#22 0x000061cc58d52d9b mlir::BytecodeReader::Impl::parseIRSection(llvm::ArrayRef<unsigned char>, mlir::Block*) (./mlir-opt+0x63ecd9b)
#23 0x000061cc58d501fd mlir::BytecodeReader::Impl::read(mlir::Block*, llvm::function_ref<bool (mlir::Operation*)>) (./mlir-opt+0x63ea1fd)
#24 0x000061cc58d58b7e readBytecodeFileImpl(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&, std::shared_ptr<llvm::SourceMgr> const&) BytecodeReader.cpp:0:0
#25 0x000061cc58d58a0e mlir::readBytecodeFile(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&) (./mlir-opt+0x63f2a0e)
#26 0x000061cc56c9bfbf mlir::parseSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (./mlir-opt+0x4335fbf)
#27 0x000061cc56c9c658 mlir::parseSourceString(llvm::StringRef, mlir::Block*, mlir::ParserConfig const&, llvm::StringRef, mlir::LocationAttr*) (./mlir-opt+0x4336658)
#28 0x000061cc56b6db44 (anonymous namespace)::TestBytecodeRoundtripPass::doRoundtripWithConfigs(mlir::Operation*, mlir::BytecodeWriterConfig const&, mlir::ParserConfig const&) TestBytecodeRoundtrip.cpp:0:0
#29 0x000061cc56b6b980 (anonymous namespace)::TestBytecodeRoundtripPass::runOnOperation() TestBytecodeRoundtrip.cpp:0:0
#30 0x000061cc56c9f08f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x433908f)
#31 0x000061cc56c9f872 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x4339872)
#32 0x000061cc56ca201e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x433c01e)
#33 0x000061cc56c9ab3b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#34 0x000061cc56c9a79b 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
#35 0x000061cc56d44f25 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) (./mlir-opt+0x43def25)
#36 0x000061cc56c95682 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x432f682)
#37 0x000061cc56c95933 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x432f933)
#38 0x000061cc56c95b42 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x432fb42)
#39 0x000061cc539c4bd7 main (./mlir-opt+0x105ebd7)
#40 0x00007a32b8644d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#41 0x00007a32b8644e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#42 0x000061cc539c4745 _start (./mlir-opt+0x105e745)
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