[llvm-bugs] [Bug 49782] New: RuntimeDyld relocation overflow (Regression in LLVM 12.rc2/trunk)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 31 03:26:34 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49782

            Bug ID: 49782
           Summary: RuntimeDyld relocation overflow (Regression in LLVM
                    12.rc2/trunk)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: wenzel.jakob at epfl.ch
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

Created attachment 24709
  --> https://bugs.llvm.org/attachment.cgi?id=24709&action=edit
Reproducer -- crashes with an assertion failure on trunk

Dear LLVM team,

I'm using LLVM to JIT-compile relocatable vectorized code across various
platforms. 

With the latest LLVM trunk, a large portion of previously working code triggers
an assertion failure while applying relocations in RuntimeDyldCOFFX86_64
(Windows/x64):

Assertion failed: ((int64_t)Result <= INT32_MAX) && "Relocation overflow", file
C:\\llvm\lib\ExecutionEngine\RuntimeDyld\Targets/RuntimeDyldCOFFX86_64.h, line
105

The same works with LLVM 10 and 11. Something very strange is happening here as
well -- if I enable debug messages, I can see the identifiers of those
relocations, and one seems to have a bogus name, and a very large addend
(4294967295 == -0x1), which is what ultimately triggers the crash.

SectionID: 12                                                                  
                                               In Section 12 Offset 78 RelType:
4 TargetName: __real at 7fffffff Addend 0                                         
      In Section 12 Offset 87 RelType: 4 TargetName: __real at 3f000000 Addend 0  
                                             In Section 12 Offset 96 RelType: 4
TargetName: __real at 40490fdb Addend 0                                           
    In Section 12 Offset 111 RelType: 4 TargetName: __real at 3f800000 Addend 0   
                                           In Section 12 Offset 126 RelType: 4
TargetName: __real at 3d2cb352 Addend 0                                           
   In Section 12 Offset 140 RelType: 4 TargetName: __real at 3cc617e3 Addend 0    
                                          In Section 12 Offset 149 RelType: 4
TargetName: __real at 3d3a3ec7 Addend 0                                           
   In Section 12 Offset 158 RelType: 4 TargetName: __real at 3d9980f6 Addend 0    
                                          In Section 12 Offset 167 RelType: 4
TargetName: __real at 3e2aaae4 Addend 0                                           
   In Section 12 Offset 176 RelType: 4 TargetName: __real at 3fc90fdb Addend 0    
                                          In Section 12 Offset 185 RelType: 4
TargetName: __real at 80000000 Addend 0                                           
   In Section 12 Offset 289 RelType: 4 TargetName:
__ymm at 0000000000000000000000000000000000000000000000000000000000000000 Addend
4294967295 

I've isolated the smallest piece of code in our test suite that triggers this
crash and wrapped into a tiny MCJIT harness. Please see the attached file.

Best,
Wenzel

PS: *NOTE*: This is DUPLICATE of Bug 49441 that I had filed some time ago in
the "Linker" category, and which was completely ignored. This is my second
attempt to get somebody to look at this issue by filing in X86.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210331/31d7d3c7/attachment.html>


More information about the llvm-bugs mailing list