Issue 128307
Summary [MLIR]`-test-bytecode-roundtrip` triggers Assertion Failure `succeeded(versionOr) && "expected reader to be able to access " "the version for test dialect"'
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 case:
```
module {
  func.func @gather_like(%arg0 : tensor<?x?xf32> {bufferization.writable = false},%arg1 : tensor<?xi32> {bufferization.writable = false},%arg2 : tensor<?x?xf32> {bufferization.writable = true}) -> ()
  {
    %0 = linalg.generic {
 indexing_maps = [affine_map<(d0, d1) -> (d0)>,affine_map<(d0, d1) -> (d0, d1)>],
        iterator_types = ["parallel", "parallel"]}
 ins(%arg1 : tensor<?xi32>) outs(%arg2 : tensor<?x?xf32>) {
 ^bb0(%arg3: i32, %arg4 : f32):
          %iv1 = linalg.index 1 : index
 %1 = arith.index_cast %arg3 : i32 to index
          %2 = tensor.extract %arg0[%1, %iv1] : tensor<?x?xf32>
          linalg.yield %2 : f32
        } -> tensor<?x?xf32>
    return
  }
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/test/lib/IR/TestBytecodeRoundtrip.cpp:170: auto (anonymous namespace)::TestBytecodeRoundtripPass::runTest0(Operation *)::(anonymous class)::operator()(DialectBytecodeReader &, StringRef, Type &) const: Assertion `succeeded(versionOr) && "expected reader to be able to access " "the version for test dialect"' 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
 #0 0x00005b9273c129b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x107f9b8)
 #1 0x00005b9273c104de llvm::sys::RunSignalHandlers() (./mlir-opt+0x107d4de)
 #2 0x00005b9273c133c8 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007a45e805a520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007a45e80ae9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007a45e805a476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007a45e80407f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007a45e804071b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007a45e8051e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00005b9276d9b0f4 (./mlir-opt+0x42080f4)
#10 0x00005b9278f87e01 (anonymous namespace)::AttrTypeReader::resolveType(unsigned long) BytecodeReader.cpp:0:0
#11 0x00005b9278f86ad7 (anonymous namespace)::DialectReader::readType(mlir::Type&) BytecodeReader.cpp:0:0
#12 0x00005b9276ff0900 (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#13 0x00005b9278f876a4 (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#14 0x00005b9278f86a37 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#15 0x00005b9276ff069c (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#16 0x00005b9278f876a4 (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#17 0x00005b9278f86a37 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#18 0x00005b9276ff3374 llvm::LogicalResult mlir::DialectBytecodeReader::readList<mlir::Attribute, llvm::LogicalResult mlir::DialectBytecodeReader::readAttributes<mlir::Attribute>(llvm::SmallVectorImpl<mlir::Attribute>&)::'lambda'(mlir::Attribute&)>(llvm::SmallVectorImpl<mlir::Attribute>&, llvm::LogicalResult mlir::DialectBytecodeReader::readAttributes<mlir::Attribute>(llvm::SmallVectorImpl<mlir::Attribute>&)::'lambda'(mlir::Attribute&)&&) (./mlir-opt+0x4460374)
#19 0x00005b9276ff0536 (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#20 0x00005b9278f876a4 (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#21 0x00005b9278f86a92 (anonymous namespace)::DialectReader::readOptionalAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#22 0x00005b92740a5276 llvm::LogicalResult mlir::DialectBytecodeReader::readOptionalAttribute<mlir::ArrayAttr>(mlir::ArrayAttr&) (./mlir-opt+0x1512276)
#23 0x00005b92742a34e7 mlir::func::FuncOp::readProperties(mlir::DialectBytecodeReader&, mlir::OperationState&) (./mlir-opt+0x17104e7)
#24 0x00005b9278f84388 mlir::BytecodeReader::Impl::parseRegions(std::vector<mlir::BytecodeReader::Impl::RegionReadState, std::allocator<mlir::BytecodeReader::Impl::RegionReadState>>&, mlir::BytecodeReader::Impl::RegionReadState&) (./mlir-opt+0x63f1388)
#25 0x00005b9278f7fd9b mlir::BytecodeReader::Impl::parseIRSection(llvm::ArrayRef<unsigned char>, mlir::Block*) (./mlir-opt+0x63ecd9b)
#26 0x00005b9278f7d1fd mlir::BytecodeReader::Impl::read(mlir::Block*, llvm::function_ref<bool (mlir::Operation*)>) (./mlir-opt+0x63ea1fd)
#27 0x00005b9278f85b7e readBytecodeFileImpl(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&, std::shared_ptr<llvm::SourceMgr> const&) BytecodeReader.cpp:0:0
#28 0x00005b9278f85a0e mlir::readBytecodeFile(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&) (./mlir-opt+0x63f2a0e)
#29 0x00005b9276ec8fbf mlir::parseSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (./mlir-opt+0x4335fbf)
#30 0x00005b9276ec9658 mlir::parseSourceString(llvm::StringRef, mlir::Block*, mlir::ParserConfig const&, llvm::StringRef, mlir::LocationAttr*) (./mlir-opt+0x4336658)
#31 0x00005b9276d9ab44 (anonymous namespace)::TestBytecodeRoundtripPass::doRoundtripWithConfigs(mlir::Operation*, mlir::BytecodeWriterConfig const&, mlir::ParserConfig const&) TestBytecodeRoundtrip.cpp:0:0
#32 0x00005b9276d986d0 (anonymous namespace)::TestBytecodeRoundtripPass::runOnOperation() TestBytecodeRoundtrip.cpp:0:0
#33 0x00005b9276ecc08f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x433908f)
#34 0x00005b9276ecc872 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x4339872)
#35 0x00005b9276ecf01e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x433c01e)
#36 0x00005b9276ec7b3b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#37 0x00005b9276ec779b 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
#38 0x00005b9276f71f25 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)
#39 0x00005b9276ec2682 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x432f682)
#40 0x00005b9276ec2933 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x432f933)
#41 0x00005b9276ec2b42 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x432fb42)
#42 0x00005b9273bf1bd7 main (./mlir-opt+0x105ebd7)
#43 0x00007a45e8041d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#44 0x00007a45e8041e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#45 0x00005b9273bf1745 _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