FW: [MLton] Working: MLton/Win64 toolchain

Nicolas Bertolotti Nicolas.Bertolotti at mathworks.fr
Mon Aug 11 16:51:29 PDT 2008


Removing -lkernel32 does not solve the issue.

But I could workaround the issue anyway following your other recommendation and replacing the local variable with a pointer and a malloc().

I could notice that Kai Tietz had submitted a patch < [patch i386]: x86_64-pc-mingw _alloca and _stkchk may corrupts stack alignment > which seems to be related to the problem you mentionned :
http://gcc.gnu.org/ml/gcc-patches/2008-01/msg01350.html
It seems that this patch should solve the issue with GMP. As I don't really know how gcc works, I wonder whether it could solve mine as well or if a similar fix should be applied elsewhere.

Now I am facing another crash (exit code 128 without any information) in pure SML code so I guess I will come back with additional feedback in a near future.

Best regards

Nicolas

________________________________
From: Wesley W. Terpstra [mailto:wesley at terpstra.ca]
Sent: Tuesday, August 12, 2008 1:27 AM
To: Nicolas Bertolotti; mlton at mlton.org
Subject: Re: FW: [MLton] Working: MLton/Win64 toolchain

First, sorry about the multiple spammed replies! Gmail told me it was failing to send and to come back later. When I came back later and sent the definitive copy of my reply, I found that all my earlier clicks had also succeeded. Oops.

On Tue, Aug 12, 2008 at 12:22 AM, Nicolas Bertolotti <Nicolas.Bertolotti at mathworks.fr<mailto:Nicolas.Bertolotti at mathworks.fr>> wrote:

You can't see it in the sample but the original piece of code on which I observed the crash is from the "zlib" ... and I thought I would not need to modify it.
Have you tried removing the -lkernel32? Does that suffice?

You mentioned that you faced a similar issue with GMP. Did you submit a bug report to the GCC team?
Well, the right people to submit the bug report to are the mingw-w64 people, specifically Kai Tietz. I didn't, because at the time I hacked around the GMP problems gcc was so broken that it hardly seemed a useful report. ;-) Now it's a lot better and maybe he should know about this. For gmp, the problem was alloca (which also allocates on the stack). Fortunately, gmp had a compile-time option to change it's use of alloca to malloc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20080812/ff68a25d/attachment.htm


More information about the MLton mailing list