Hugs on Windows, FFI

Brian Smith brianlsmith at gmail.com
Sun Sep 11 14:04:22 EDT 2005


On 9/9/05, Neil Mitchell <ndmitchell at gmail.com> wrote:
> 
> Hi,
> 
> Running "make check" I get the following, dropping most of the
> begining since it seems sensible enough. Apparently this should show
> if FFI works on Windows?


I noticed that your test results didn't include failures for
Sparc.hs/Callback.hs/Sin.hs.
After more investigation, I found that these tests only fail when Windows 
Data Execution Prevention (DEP) [1] is enabled. When I disable DEP for 
hugs.exe, these tests pass; when I enabled DEP then the tests fail. So, 
apparently the code that builds the thunks used for callbacks does not 
correctly set the executable/non-writable flags on the thunk after it is 
created. There was a very similar bug in GHCi/runghc that was fixed just a 
few weeks ago. 

I think the solution to this problem is probably simple for somebody 
familiar with the GHCi solution, or somebody familiar with the Windows 
memory management API's. But, failing a fix, we should at least note this 
problem in the release notes, and the installer should automatically disable 
DEP for hugs.exe, runhugs.exe, and WinHugs.exe.

[1] http://support.microsoft.com/kb/875352

- Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/cvs-hugs/attachments/20050911/443eec1f/attachment.htm


More information about the Cvs-hugs mailing list