Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm] Fix assertion error where we didn't check fixed point types. #80757

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

PiJoules
Copy link
Contributor

@PiJoules PiJoules commented Feb 5, 2024

This fixes #81555

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 5, 2024

@llvm/pr-subscribers-debuginfo

Author: None (PiJoules)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/80757.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp (+3)
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index eb2d992c7e75e..f00ff1565c665 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -224,12 +224,15 @@ bool DebugHandlerBase::isUnsignedDIType(const DIType *Ty) {
           Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF ||
           Encoding == dwarf::DW_ATE_boolean ||
           Encoding == dwarf::DW_ATE_complex_float ||
+          Encoding == dwarf::DW_ATE_signed_fixed ||
+          Encoding == dwarf::DW_ATE_unsigned_fixed ||
           (Ty->getTag() == dwarf::DW_TAG_unspecified_type &&
            Ty->getName() == "decltype(nullptr)")) &&
          "Unsupported encoding");
   return Encoding == dwarf::DW_ATE_unsigned ||
          Encoding == dwarf::DW_ATE_unsigned_char ||
          Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean ||
+         Encoding == llvm::dwarf::DW_ATE_unsigned_fixed ||
          Ty->getTag() == dwarf::DW_TAG_unspecified_type;
 }
 

@MaskRay
Copy link
Member

MaskRay commented Feb 9, 2024

Test?

@PiJoules
Copy link
Contributor Author

Test?

Added one to test the crash doesn't happen

llvm/test/DebugInfo/fixed-point.ll Outdated Show resolved Hide resolved
@@ -0,0 +1,26 @@
;; This fixes https://github.com/llvm/llvm-project/issues/81555
;; Note this isn't correct dwarf but we just need to assert this doesn't crash.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't correct, should we instead reject it in the IR Verifier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Assuming I'm using the verify correctly, it looks like this dwarf actually is valid.

@PiJoules
Copy link
Contributor Author

ping

lntue added a commit to lntue/llvm-project that referenced this pull request Feb 15, 2024
lntue added a commit that referenced this pull request Feb 16, 2024
@PiJoules PiJoules merged commit 1807e02 into llvm:main Feb 16, 2024
3 of 4 checks passed
@PiJoules PiJoules deleted the handle-fixed-point-debuginfo branch February 16, 2024 07:29
lntue added a commit that referenced this pull request Feb 16, 2024
@vvereschaka
Copy link
Contributor

@PiJoules,

it breaks at least four builders

Program aborted due to an unhandled Error:
createMCCodeEmitter failed
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/llc /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/DebugInfo/fixed-point.ll -filetype=obj -o -
 #0 0x00007ff0f75fefb0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib/libLLVMSupport.so.19git+0x1dafb0)
 #1 0x00007ff0f75fc3bf llvm::sys::RunSignalHandlers() (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib/libLLVMSupport.so.19git+0x1d83bf)
 #2 0x00007ff0f75fc515 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007ff0f6c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007ff0f6c969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007ff0f6c969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007ff0f6c969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007ff0f6c42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007ff0f6c287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007ff0f751727b llvm::Error::fatalUncheckedError() const (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib/libLLVMSupport.so.19git+0xf327b)
#10 0x00007ff0f93866d8 llvm::LLVMTargetMachine::addAsmPrinter(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, llvm::MCContext&) (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib/libLLVMCodeGen.so.19git+0x30d6d8)
#11 0x00007ff0f9386825 llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*) (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/lib/libLLVMCodeGen.so.19git+0x30d825)
#12 0x00005654e6bd07a0 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#13 0x00005654e6bc6336 main (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/llc+0xf336)
#14 0x00007ff0f6c29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#15 0x00007ff0f6c29e40 call_init ./csu/../csu/libc-start.c:128:20
#16 0x00007ff0f6c29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#17 0x00005654e6bc6e95 _start (/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/llc+0xfe95)
error: -: The file was not recognized as a valid object file
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/DebugInfo/fixed-point.ll

there is the same for win builds too.

vvereschaka added a commit that referenced this pull request Feb 20, 2024
…types." (#82285)

These changes break the `LLVM::fixed-point.ll` test some targets what
fails the builds for those targets
(more details
#80757 (comment))

The problem wasn't fixed for few days,

Reverts #80757
@PiJoules
Copy link
Contributor Author

Sorry for the breakages and thanks for the revert. I probably shouldn't have pushed right before an extended weekend :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Unsupported encoding"' failed. Aborted
5 participants