Issue 173373
Summary mlir-opt crashes in mlir/lib/AsmParser/AttributeParser.cpp:863
Labels mlir, crash
Assignees
Reporter Emilyaxe
    When running opt on the following IR, mlir-opt crashes. 

version 2c02e4c7909a

test.mlir

```
func.func @test_permute_fill_to_scalar(%arg: tensor<13x21x3xf32>) -> tensor<13x1x21xf32> {
  %init = tensor.empty() : tensor<21x3xf32>
  %fill = linalg.fill ins(%arg: tensor<13x21x3xf32>) outs(%init: tensor<21x3xf32>)
 {permutation = array<i1: 1, 0>} : (tensor<13x21x3xf32>, tensor<21x3xf32>) -> tensor<21x3xf32>
  return %fill : tensor<21x1x21xf32>
}

```


commads:

mlir-opt test.mlir

stacktrace

```
mlir-opt: llvm-project/mlir/lib/AsmParser/AttributeParser.cpp:863: void (anonymous namespace)::DenseArrayElementParser::append(const APInt &): Assertion `data.getBitWidth() % 8 == 0' failed.
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: ./bin/mlir-opt test.mlir
1.      MLIR Parser: custom op parser 'func.func'
2.      MLIR Parser: custom op parser 'linalg.fill'
 #0 0x000055d5555a3358 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./bin/mlir-opt+0x1e97358)
 #1 0x000055d5555a0a15 llvm::sys::RunSignalHandlers() (./bin/mlir-opt+0x1e94a15)
 #2 0x000055d5555a4396 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f95c3777420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f95c2dd000b raise /build/glibc-B3wQXB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f95c2daf859 abort /build/glibc-B3wQXB/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f95c2daf729 get_sysdep_segment_value /build/glibc-B3wQXB/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f95c2daf729 _nl_load_domain /build/glibc-B3wQXB/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f95c2dc0fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x000055d55c62d178 (./bin/mlir-opt+0x8f21178)
#10 0x000055d55c604e33 mlir::detail::Parser::parseCommaSeparatedList(mlir::AsmParser::Delimiter, llvm::function_ref<llvm::ParseResult ()>, llvm::StringRef) (./bin/mlir-opt+0x8ef8e33)
#11 0x000055d55c627a5c mlir::detail::Parser::parseDenseArrayAttr(mlir::Type) (./bin/mlir-opt+0x8f1ba5c)
#12 0x000055d55c62c514 llvm::ParseResult llvm::function_ref<llvm::ParseResult ()>::callback_fn<mlir::detail::Parser::parseAttributeDict(mlir::NamedAttrList&)::$_0>(long) AttributeParser.cpp:0:0
#13 0x000055d55c604e33 mlir::detail::Parser::parseCommaSeparatedList(mlir::AsmParser::Delimiter, llvm::function_ref<llvm::ParseResult ()>, llvm::StringRef) (./bin/mlir-opt+0x8ef8e33)
#14 0x000055d55c627b89 mlir::detail::Parser::parseAttributeDict(mlir::NamedAttrList&) (./bin/mlir-opt+0x8f1bb89)
#15 0x000055d55c1c0d03 parseNamedStructuredOp(mlir::OpAsmParser&, mlir::OperationState&, unsigned int, llvm::function_ref<void (mlir::ImplicitLocOpBuilder&, mlir::Block&, llvm::ArrayRef<mlir::NamedAttribute>, llvm::function_ref<mlir::InFlightDiagnostic ()>)>) LinalgOps.cpp:0:0
#16 0x000055d55c20e8ec mlir::linalg::FillOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (./bin/mlir-opt+0x8b028ec)
#17 0x000055d55c608f11 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#18 0x000055d55c614a14 (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) Parser.cpp:0:0
#19 0x000055d55c61283c (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#20 0x000055d55c610aac (anonymous namespace)::CustomOpAsmParser::parseOptionalRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#21 0x000055d55ddb1ce2 mlir::function_interface_impl::parseFunctionOp(mlir::OpAsmParser&, mlir::OperationState&, bool, mlir::StringAttr, llvm::function_ref<mlir::Type (mlir::Builder&, llvm::ArrayRef<mlir::Type>, llvm::ArrayRef<mlir::Type>, mlir::function_interface_impl::VariadicFlag, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)>, mlir::StringAttr, mlir::StringAttr) (./bin/mlir-opt+0xa6a5ce2)
#22 0x000055d55c98156a mlir::func::FuncOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (./bin/mlir-opt+0x927556a)
#23 0x000055d55c608f11 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#24 0x000055d55c607cad mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) (./bin/mlir-opt+0x8efbcad)
#25 0x000055d55c5ec4d3 mlir::parseSourceFile(std::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (./bin/mlir-opt+0x8ee04d3)
#26 0x000055d555647afe mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) (./bin/mlir-opt+0x1f3bafe)
#27 0x000055d555646827 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#28 0x000055d5556465a6 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#29 0x000055d55df78855 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (./bin/mlir-opt+0xa86c855)
#30 0x000055d55563c166 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./bin/mlir-opt+0x1f30166)
#31 0x000055d55563c4a2 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f304a2)
#32 0x000055d55563c805 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f30805)
#33 0x000055d5555899b3 main (./bin/mlir-opt+0x1e7d9b3)
#34 0x00007f95c2db1083 __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:342:3
#35 0x000055d5555894ee _start (./bin/mlir-opt+0x1e7d4ee)
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to