[MLton] Crashes with 64-bit native code generator on Windows

David Hansel hansel at reactive-systems.com
Thu Dec 3 05:40:08 PST 2009


Hi,

Just in case someone comes across this thread in the future:
Matthew Fluet fixed the problem that was causing these crashes
in r7368.

Many thanks,

David


Matthew Fluet wrote:
> On Mon, Nov 30, 2009 at 4:19 PM, David Hansel
> <hansel at reactive-systems.com <mailto:hansel at reactive-systems.com>> wrote:
> 
>     I tried using "-native-commented 6" but (due to the size of the code
>     involved)
>     compilation (in the "outputAssembly" stage) seems to take a VERY
>     long time.
>     I also tried "-native-commented 5" with the same result.  A setting
>     of "4"
>     worked much faster and I have uploaded a file hansel-20091130-1.s
>     containing
>     the basic block.
> 
> 
> That seems to be enough to provide a hint.  I think that the issue is
> that the function address got placed in %r11, which is a caller save
> register.  The contents of caller save registers are pushed to memory
> immediately before the call instruction, for any register whose content
> is live after the call and purged from the register allocation.  Of
> course, the function address is still live *at* the call instruction,
> although it is not live after the call instruction.  Small examples seem
> to favor %r15 as the register into which the function address is placed,
> which is not caller save, and so not susceptible to this issue.  It also
> fits with small changes near the indirect function call eliminating the
> segfault; such changes alter the liveness and used registers and
> presumably the function address get stored in a non-caller save
> register.  If this is indeed the source of the issue, then it is simply
> a native amd64 codegen bug (and, possibly, a latent x86 codegen bug as
> well) and is independent of the target OS; that is, it is not mingw
> specific.
> 

-- 
  ----------------------------------------------------------
  David Hansel
  http://www.reactive-systems.com/
  OpenPGP (GnuPG) public key file:
  http://www.reactive-systems.com/~hansel/pgp_public_key.txt
  ----------------------------------------------------------



More information about the MLton mailing list