[Vm-dev] Cog on Mac. Problems with mprotect()?

Mariano Martinez Peck marianopeck at gmail.com
Tue Dec 14 10:58:58 UTC 2010


Hi Igor. I think I have a similar/same problem. I tried what you suggested
about changing interpreterAllocationReserveBytes

I think it now doesn't crash because of that (I think), but the message

mprotect(x,y,PROT_READ | PROT_WRITE | PROT_EXEC): Cannot allocate memory
mprotect(x,y,PROT_READ | PROT_WRITE): Invalid argument

is still present. As far as I understood you said your crash was not due to
that...but anyway, is that really a problem? is it fixed somewhere?
because I am having weird crashes and I cannot discover why.

thanks

mariano

2010/12/6 Igor Stasenko <siguctua at gmail.com>

>
> OK, i changed
>
> interpreterAllocationReserveBytes
>        | availableBytesPerPage maxFramesPerPage |
>        availableBytesPerPage := self stackPageByteSize - self
> stackLimitOffset - self stackPageHeadroom.
>        maxFramesPerPage := availableBytesPerPage / BytesPerWord //
> MFrameSlots.
>        ^2 raisedTo: (maxFramesPerPage * LargeContextSize * numStackPages)
> highBit
>
> to:
>
> interpreterAllocationReserveBytes
>        | availableBytesPerPage maxFramesPerPage |
>        availableBytesPerPage := self stackPageByteSize - self
> stackLimitOffset - self stackPageHeadroom.
>        maxFramesPerPage := availableBytesPerPage / BytesPerWord //
> MFrameSlots.
>        ^2 << ((maxFramesPerPage * LargeContextSize * numStackPages) highBit
> -1)
>
>
> which is equal, except that latter its not using pow() function and
> somehow this no longer crashing the VM.
> The only conclusion i can make that this is really have nothing to do
> with mprotect() and other mmap() stuff.
>
> I can only guess, that xcode doing some aggressive optimization,
> violating calling conventions, or in some other way the fullGC is
> optimized in a way
> that it expected to be called from certain places (but obviously not
> from native code generated on the fly).
>
> That's really weird.
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101214/98dbd6f8/attachment.htm


More information about the Vm-dev mailing list