[MLton] reason for mprotect with PROT_EXEC ?

Adam Goode adam at spicenitz.org
Wed Feb 6 17:26:14 PST 2008


Hi,

runtime/platform/mmap-protect.c line 10 contains an mprotect with
PROT_READ | PROT_WRITE | PROT_EXEC.

Is PROT_EXEC needed? I'm asking because MLton compiled executables will
fail on Fedora 9 with this.

The function is GC_mmapAnon_safe_protect, and it looks like it is only
called once, through GC_init and initSignalStack. I doubt the signal
stack needs to be executable, but I am not totally sure. Am I right that
profiling is the only thing that uses the signal stack?

I think we should take out the PROT_EXEC. If we don't, all MLton
compiled executables will need to be given special privileges to run on
Fedora 9.

I can check in a patch to do it if it's the right thing. (It is already
prepared.)


Thanks,

Adam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://mlton.org/pipermail/mlton/attachments/20080206/63c5459f/signature.pgp


More information about the MLton mailing list