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

            Bug ID: 49441
           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: Linker
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 24589
  --> https://bugs.llvm.org/attachment.cgi?id=24589&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@7fffffff Addend 0                                         
      In Section 12 Offset 87 RelType: 4 TargetName: __real@3f000000 Addend 0  
                                             In Section 12 Offset 96 RelType: 4
TargetName: __real@40490fdb Addend 0                                           
    In Section 12 Offset 111 RelType: 4 TargetName: __real@3f800000 Addend 0   
                                           In Section 12 Offset 126 RelType: 4
TargetName: __real@3d2cb352 Addend 0                                           
   In Section 12 Offset 140 RelType: 4 TargetName: __real@3cc617e3 Addend 0    
                                          In Section 12 Offset 149 RelType: 4
TargetName: __real@3d3a3ec7 Addend 0                                           
   In Section 12 Offset 158 RelType: 4 TargetName: __real@3d9980f6 Addend 0    
                                          In Section 12 Offset 167 RelType: 4
TargetName: __real@3e2aaae4 Addend 0                                           
   In Section 12 Offset 176 RelType: 4 TargetName: __real@3fc90fdb Addend 0    
                                          In Section 12 Offset 185 RelType: 4
TargetName: __real@80000000 Addend 0                                           
   In Section 12 Offset 289 RelType: 4 TargetName:
__ymm@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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to