Mikhail Lyapunov
2014-Jan-17 23:11 UTC
[LLVMdev] Offset overflow on calling __chkstc and __alloca
Hi, Attempting to use LLVM in jitting mode for AMD64, we met a problem. When the jitted routine needs a big stack frame (> 1 page), the system attempts to call __chkstk to probe the stack. This attempt results in assertion in RuntimeDyldELF::resolveX86_64Relocation(), case ELF::R_X86_64_PC32, because the RealOffset does not fit in 32 bits. Same happens with __alloca (when IRBuilder::CreateAlloca appears in a conditional block). Perhaps the issue can be fixed by using indirect call via 64-bit register or replicating service routines inside jitted block. Is it known issue? Repro is available on demand, just let us know in which form you'd like to get it. Regards, Mikhail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140117/3f7e80bd/attachment.html>
Rafael Espíndola
2014-Jan-23 16:50 UTC
[LLVMdev] Offset overflow on calling __chkstc and __alloca
On 17 January 2014 18:11, Mikhail Lyapunov <mikhaill at microsoft.com> wrote:> Hi, > > > > Attempting to use LLVM in jitting mode for AMD64, we met a problem. > > When the jitted routine needs a big stack frame (> 1 page), the system > attempts to call __chkstk to probe the stack. > > This attempt results in assertion in > RuntimeDyldELF::resolveX86_64Relocation(), case ELF::R_X86_64_PC32, > > because the RealOffset does not fit in 32 bits. > > > > Same happens with __alloca (when IRBuilder::CreateAlloca appears in a > conditional block). > > Perhaps the issue can be fixed by using indirect call via 64-bit register or > replicating service routines inside jitted block. > > > > Is it known issue? > > Repro is available on demand, just let us know in which form you’d like to > get it.Opening a bug with it is probably a good idea. Cheers, Rafael
Mikhail Lyapunov
2014-Jan-23 17:04 UTC
[LLVMdev] Offset overflow on calling __chkstc and __alloca
The bug is opened already, #18582. Thanks, Mikhail -----Original Message----- From: Rafael Espíndola [mailto:rafael.espindola at gmail.com] Sent: Thursday, January 23, 2014 8:50 AM To: Mikhail Lyapunov Cc: llvmbugs at cs.uiuc.edu; llvmdev at cs.uiuc.edu; Jeff Morgan; Yuri Dotsenko Subject: Re: [LLVMdev] Offset overflow on calling __chkstc and __alloca On 17 January 2014 18:11, Mikhail Lyapunov <mikhaill at microsoft.com> wrote:> Hi, > > > > Attempting to use LLVM in jitting mode for AMD64, we met a problem. > > When the jitted routine needs a big stack frame (> 1 page), the system > attempts to call __chkstk to probe the stack. > > This attempt results in assertion in > RuntimeDyldELF::resolveX86_64Relocation(), case ELF::R_X86_64_PC32, > > because the RealOffset does not fit in 32 bits. > > > > Same happens with __alloca (when IRBuilder::CreateAlloca appears in a > conditional block). > > Perhaps the issue can be fixed by using indirect call via 64-bit > register or replicating service routines inside jitted block. > > > > Is it known issue? > > Repro is available on demand, just let us know in which form you’d > like to get it.Opening a bug with it is probably a good idea. Cheers, Rafael
Reasonably Related Threads
- [LLVMdev] Assertions in RuntimeDyldELF in ExecutionEngine/MCJIT tests
- [LLVMdev] Assertions in RuntimeDyldELF in ExecutionEngine/MCJIT tests
- [LLVMdev] Assertions in RuntimeDyldELF in ExecutionEngine/MCJIT tests
- [LLVMdev] Assertions in RuntimeDyldELF in ExecutionEngine/MCJIT tests
- [LLVMdev] Assertions in RuntimeDyldELF in ExecutionEngine/MCJIT tests