Issue 173376
Summary mlir-opt crashes in mlir::Operation::create
Labels mlir, crash
Assignees
Reporter Emilyaxe
    When running opt on the following IR, mlir-opt crashes. 

version 2c02e4c7909a

test.mlir

```
func.func @non_default_failure2() {
 "test"() ({
    "test.non_fpl_block"() : () -> ()
  }) : () -> ()
 return
}

```


commads:

mlir-opt test.mlir

stacktrace

```
LLVM ERROR: test created with unregistered dialect. If this is intended, please call allowUnregisteredDialects() on the MLIRContext, or use -allow-unregistered-dialect with the MLIR tool used.
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'
 #0 0x000055d13ef30358 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./bin/mlir-opt+0x1e97358)
 #1 0x000055d13ef2da15 llvm::sys::RunSignalHandlers() (./bin/mlir-opt+0x1e94a15)
 #2 0x000055d13ef31396 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f73f5a28420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f73f508100b raise /build/glibc-B3wQXB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f73f5060859 abort /build/glibc-B3wQXB/glibc-2.31/stdlib/abort.c:81:7
 #6 0x000055d13ef16e18 llvm::report_fatal_error(llvm::Twine const&, bool) (./bin/mlir-opt+0x1e7de18)
 #7 0x000055d1478c8d9d (./bin/mlir-opt+0xa82fd9d)
 #8 0x000055d1478c8524 mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::OpaqueProperties, mlir::BlockRange, unsigned int) (./bin/mlir-opt+0xa82f524)
 #9 0x000055d1478c80b7 mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::NamedAttrList&&, mlir::OpaqueProperties, mlir::BlockRange, mlir::RegionRange) (./bin/mlir-opt+0xa82f0b7)
#10 0x000055d1478c7f74 mlir::Operation::create(mlir::OperationState const&) (./bin/mlir-opt+0xa82ef74)
#11 0x000055d147810600 mlir::OpBuilder::create(mlir::OperationState const&) (./bin/mlir-opt+0xa777600)
#12 0x000055d145f98a93 (anonymous namespace)::OperationParser::parseGenericOperation() Parser.cpp:0:0
#13 0x000055d145f95b9a (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#14 0x000055d145fa1a14 (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) Parser.cpp:0:0
#15 0x000055d145f9f6b5 (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#16 0x000055d145f9daac (anonymous namespace)::CustomOpAsmParser::parseOptionalRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#17 0x000055d14773ece2 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)
#18 0x000055d14630e56a mlir::func::FuncOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (./bin/mlir-opt+0x927556a)
#19 0x000055d145f95f11 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#20 0x000055d145f94cad mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) (./bin/mlir-opt+0x8efbcad)
#21 0x000055d145f794d3 mlir::parseSourceFile(std::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (./bin/mlir-opt+0x8ee04d3)
#22 0x000055d13efd4afe mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) (./bin/mlir-opt+0x1f3bafe)
#23 0x000055d13efd3827 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#24 0x000055d13efd35a6 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
#25 0x000055d147905855 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)
#26 0x000055d13efc9166 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./bin/mlir-opt+0x1f30166)
#27 0x000055d13efc94a2 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f304a2)
#28 0x000055d13efc9805 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f30805)
#29 0x000055d13ef169b3 main (./bin/mlir-opt+0x1e7d9b3)
#30 0x00007f73f5062083 __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:342:3
#31 0x000055d13ef164ee _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