[LLVMdev] Crashes on Windows 8 with >4k stack frames
Anton Korobeynikov
anton at korobeynikov.info
Tue Jun 30 03:17:31 PDT 2015
Make sure the stack probes are emitted (__alloca / chkstk) and that
they indeed do probe the memory.
On Tue, Jun 30, 2015 at 12:21 PM, Ephrim Khong <dr.khong at gmail.com> wrote:
> Hi All,
>
> we have an issue with our LLVM-based JIT compiler - executing the compiled
> code corrupts memory (and subsequently crashes) if we alloca more than 4k of
> variables (more than 511 8-byte ints). The same code works on Windows 7 (32
> and 64 bit), Linux, MacOS. We compile LLVM and our program with Microsoft's
> Visual Studio 2010. Both debug and release builds are affected.
>
> The variables are created en-block at the beginning of the function with
> code looking like
>
> for (i=0; i<513; ++i) {
> AllocaInst *variable =
> mBuilder.CreateAlloca(Type::getInt64Ty(mContext),0,"");
> mBuilder.CreateStore(GetConstI("INT4_8",0),variable);
> }
>
> We have not yet looked at the compiled machine code (same on Win 7 and 8, or
> differs?). But the 4k limit made us suspicious, as there were some bug
> reports - some still open - regarding this limit with LLVM [1,2].
>
> So the question is - before digging into this for more days - is there some
> known issue with this, or does anyone have an idea what might go wrong?
>
> Thanks,
> Eph
>
> [1] https://llvm.org/bugs/show_bug.cgi?id=2921
> [2] https://llvm.org/bugs/show_bug.cgi?id=8919
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
More information about the llvm-dev
mailing list