Issue 160721
Summary mlir-translate crashes on mlir/test/Dialect/LLVMIR/tbaa-roundtrip.mlir
Labels mlir:llvm, crash
Assignees
Reporter k-arrows
    Reproducible on godbolt:
https://godbolt.org/z/63b3Mbx7E

Backtrace:
```console
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: /opt/compiler-explorer/mlir-trunk/bin/mlir-translate -o /app/example.out.mlir -mlir-to-llvmir <source>
 #0 0x0000000001accbe8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x1accbe8)
 #1 0x0000000001aca064 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x000078efc9842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00000000019b49b3 mlir::StringAttr::getValue() const (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19b49b3)
 #4 0x0000000000d11dc4 std::_Function_handler<mlir::WalkResult (mlir::Attribute), std::enable_if<!is_same_v<mlir::LLVM::TBAARootAttr, mlir::Attribute> || is_same_v<void, void>, void>::type mlir::AttrTypeWalker::addWalk<mlir::LLVM::ModuleTranslation::createTBAAMetadata()::'lambda'(mlir::LLVM::TBAARootAttr), mlir::LLVM::TBAARootAttr, mlir::Attribute, void>(mlir::LLVM::ModuleTranslation::createTBAAMetadata()::'lambda'(mlir::LLVM::TBAARootAttr)&&)::'lambda'(mlir::Attribute)>::_M_invoke(std::_Any_data const&, mlir::Attribute&&) ModuleTranslation.cpp:0:0
 #5 0x00000000019a8602 mlir::WalkResult mlir::AttrTypeWalker::walkImpl<mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>>(mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>&, mlir::WalkOrder) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a8602)
 #6 0x00000000019a954d void llvm::function_ref<void (mlir::Attribute)>::callback_fn<mlir::WalkResult mlir::AttrTypeWalker::walkSubElements<mlir::Attribute>(mlir::Attribute, mlir::WalkOrder)::'lambda'(mlir::Attribute)>(long, mlir::Attribute) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a954d)
 #7 0x000000000140d973 void llvm::function_ref<void (mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>::callback_fn<mlir::detail::StorageUserBase<mlir::LLVM::TBAAMemberAttr, mlir::Attribute, mlir::LLVM::detail::TBAAMemberAttrStorage, mlir::detail::AttributeUniquer>::getWalkImmediateSubElementsFn()::'lambda'(auto, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>(long, mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x140d973)
 #8 0x00000000019a8794 mlir::WalkResult mlir::AttrTypeWalker::walkImpl<mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>>(mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>&, mlir::WalkOrder) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a8794)
 #9 0x00000000019a954d void llvm::function_ref<void (mlir::Attribute)>::callback_fn<mlir::WalkResult mlir::AttrTypeWalker::walkSubElements<mlir::Attribute>(mlir::Attribute, mlir::WalkOrder)::'lambda'(mlir::Attribute)>(long, mlir::Attribute) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a954d)
#10 0x000000000140f12f void llvm::function_ref<void (mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>::callback_fn<mlir::detail::StorageUserBase<mlir::LLVM::TBAATypeDescriptorAttr, mlir::LLVM::TBAANodeAttr, mlir::LLVM::detail::TBAATypeDescriptorAttrStorage, mlir::detail::AttributeUniquer, mlir::OpAsmAttrInterface::Trait>::getWalkImmediateSubElementsFn()::'lambda'(auto, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>(long, mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x140f12f)
#11 0x00000000019a8794 mlir::WalkResult mlir::AttrTypeWalker::walkImpl<mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>>(mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>&, mlir::WalkOrder) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a8794)
#12 0x00000000019a954d void llvm::function_ref<void (mlir::Attribute)>::callback_fn<mlir::WalkResult mlir::AttrTypeWalker::walkSubElements<mlir::Attribute>(mlir::Attribute, mlir::WalkOrder)::'lambda'(mlir::Attribute)>(long, mlir::Attribute) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a954d)
#13 0x000000000140ee93 void llvm::function_ref<void (mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>::callback_fn<mlir::detail::StorageUserBase<mlir::LLVM::TBAATagAttr, mlir::Attribute, mlir::LLVM::detail::TBAATagAttrStorage, mlir::detail::AttributeUniquer, mlir::OpAsmAttrInterface::Trait>::getWalkImmediateSubElementsFn()::'lambda'(auto, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>(long, mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x140ee93)
#14 0x00000000019a8794 mlir::WalkResult mlir::AttrTypeWalker::walkImpl<mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>>(mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>&, mlir::WalkOrder) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a8794)
#15 0x00000000019a954d void llvm::function_ref<void (mlir::Attribute)>::callback_fn<mlir::WalkResult mlir::AttrTypeWalker::walkSubElements<mlir::Attribute>(mlir::Attribute, mlir::WalkOrder)::'lambda'(mlir::Attribute)>(long, mlir::Attribute) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a954d)
#16 0x00000000019b175f void llvm::function_ref<void (mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>::callback_fn<mlir::detail::StorageUserBase<mlir::ArrayAttr, mlir::Attribute, mlir::detail::ArrayAttrStorage, mlir::detail::AttributeUniquer>::getWalkImmediateSubElementsFn()::'lambda'(auto, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>)>(long, mlir::Attribute, llvm::function_ref<void (mlir::Attribute)>, llvm::function_ref<void (mlir::Type)>) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19b175f)
#17 0x00000000019a8794 mlir::WalkResult mlir::AttrTypeWalker::walkImpl<mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>>(mlir::Attribute, std::vector<std::function<mlir::WalkResult (mlir::Attribute)>, std::allocator<std::function<mlir::WalkResult (mlir::Attribute)>>>&, mlir::WalkOrder) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x19a8794)
#18 0x0000000000d11ba9 _ZN4llvm12function_refIFvPN4mlir9OperationEEE11callback_fnIZNS1_6detail4walkILNS1_9WalkOrderE1ENS1_15ForwardIteratorEZNS1_4LLVM17ModuleTranslation18createTBAAMetadataEvEUlNSB_24AliasAnalysisOpInterfaceEE2_SD_vEENSt9enable_ifIXaantsrSt11disjunctionIJSt7is_sameIT2_S3_ESH_ISI_PNS1_6RegionEESH_ISI_PNS1_5BlockEEEE5valuesrSH_IT3_vE5valueESR_E4typeES3_OT1_EUlS3_E_EEvlS3_ ModuleTranslation.cpp:0:0
#19 0x0000000000d11252 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (.constprop.1) ModuleTranslation.cpp:0:0
#20 0x0000000000d19c4d mlir::LLVM::ModuleTranslation::createTBAAMetadata() (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0xd19c4d)
#21 0x0000000000d2c2a0 mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef, bool) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0xd2c2a0)
#22 0x0000000000486bad std::_Function_handler<llvm::LogicalResult (mlir::Operation*, llvm::raw_ostream&), mlir::registerToLLVMIRTranslation()::'lambda'(mlir::Operation*, llvm::raw_ostream&)>::_M_invoke(std::_Any_data const&, mlir::Operation*&&, llvm::raw_ostream&) ConvertToLLVMIR.cpp:0:0
#23 0x000000000045520d mlir::TranslateFromMLIRRegistration::TranslateFromMLIRRegistration(llvm::StringRef, llvm::StringRef, std::function<llvm::LogicalResult (mlir::Operation*, llvm::raw_ostream&)> const&, std::function<void (mlir::DialectRegistry&)> const&)::'lambda'(std::shared_ptr<llvm::SourceMgr> const&, llvm::raw_ostream&, mlir::MLIRContext*)::operator()(std::shared_ptr<llvm::SourceMgr> const&, llvm::raw_ostream&, mlir::MLIRContext*) const Translation.cpp:0:0
#24 0x0000000000451ea7 mlir::mlirTranslateMain(int, char**, llvm::StringRef)::'lambda0'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const (.isra.0) MlirTranslateMain.cpp:0:0
#25 0x0000000000452216 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::mlirTranslateMain(int, char**, llvm::StringRef)::'lambda0'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirTranslateMain.cpp:0:0
#26 0x00000000004616f9 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::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)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) ToolUtilities.cpp:0:0
#27 0x000000000046196e 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) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x46196e)
#28 0x0000000000462024 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) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x462024)
#29 0x0000000000452de6 mlir::mlirTranslateMain(int, char**, llvm::StringRef) (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x452de6)
#30 0x0000000000419cc4 main (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x419cc4)
#31 0x000078efc9829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#32 0x000078efc9829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#33 0x0000000000450775 _start (/opt/compiler-explorer/mlir-trunk/bin/mlir-translate+0x450775)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```

The above reproducer comes from the following:
https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/LLVMIR/tbaa-roundtrip.mlir
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to