[LLVMdev] MCJIT longjmp failure on Win64 - was Invalid or unaligned stack exception on Windows

Dibyendu Majumdar mobile at majumdar.org.uk
Tue Apr 28 01:59:47 PDT 2015


On 28 April 2015 at 00:30, Reid Kleckner <rnk at google.com> wrote:
> I think Paweł identified the problem. The frames on the stack between the
> setjmp and longjmp must have valid unwind information, which is described
> here:
> https://msdn.microsoft.com/en-us/library/ft9x1kdx.aspx?f=255&MSPPError=-2147217396
>
> In particular, it has this line about JITed code:
>   "For dynamically generated functions [JIT compilers], the runtime to
> support these functions must either use RtlInstallFunctionTableCallback or
> RtlAddFunctionTable to provide this information to the operating system.
> Failure to do so will result in unreliable exception handling and debugging
> of processes."
>
> LLVM does not contain any references to these functions, so I must conclude
> that unwinding through LLVM JITed frames on Win64 is not supported. Sorry.
> :-(
>

Now that I know what to look for it seems there are a number of posts
on this issue:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-October/078332.html

I am changing the subject so that more people can find this topic.


Re your suggestion to use my own longjmp/setjmp - do you mean I should
use the LLVM intrinsics? But would they not call the Windows API
anyway?

I am also wondering if mingw gcc compilers have the same issue.

Thanks and Regards
Dibyendu




More information about the llvm-dev mailing list