[Mono-dev] Stack size with mono-2.6.1

Rodrigo Kumpera kumpera at gmail.com
Wed Jan 6 11:02:03 EST 2010


The long term fix is actually to rework the way I fixed it, but it requires
quite some work.
This is going to happen and we'll backport most of it to 2.6 once it's
stable.




On Wed, Jan 6, 2010 at 1:57 PM, Thierry Lafage <thierry.lafage at inria.fr>wrote:

> Thanks for your answer.
> I'll try one of your solutions.
>
> IMHO, a nice long term fix for it would be to provide a command-line option
> to set a max value different from the default's, as for java and heap size
> (-Xmx). This way, one could fine tune according to the running application.
>
> Regards,
>
> Thierry Lafage.
>
>
>
> Rodrigo Kumpera a écrit :
>
>> This was a stop-gap hack I added to fix a security issue.
>>
>> The value is hardcoded into mono's source and until we figure out a long
>> term fix for it, the only solution is to custom compile mono.
>>
>> I have a patch that improves the JIT to use smaller stacks, but it's
>> against trunk
>> and remains experimental.
>>
>> Besides that, we need to fix all unbounded code expansion to really
>> support big
>> stack. Work on this have not been started.
>>
>> Right now, the only remedy for you is to custom build mono after either
>> removing
>> the stack check[1] or increase it[2]. Be aware that such changes do have
>> security
>> implications.
>>
>> Sorry for this,
>> Rodrigo Kumpera
>>
>> [1]To remove it, edit mini-x86.c or mini-amd64.c. Search for
>> MONO_ARCH_MAX_FRAME_SIZE
>> and remove the if that uses it.
>>
>> [2]To increase it, change the define MONO_ARCH_MAX_FRAME_SIZE in either
>> mini-x86.h or mini-amd64.h depending if you're building a 32 or 64 bits
>> mono.
>>
>>
>>
>>
>> On Wed, Jan 6, 2010 at 9:02 AM, Thierry Lafage <thierry.lafage at inria.fr<mailto:
>> thierry.lafage at inria.fr>> wrote:
>>
>>    Hi all,
>>
>>    I have a problem with a code running with mono-2.6.1.
>>    It says :
>>    "Unhandled Exception: System.InvalidProgramException: Method toto:main
>>    () stack is too big."
>>
>>    This problem does not appear with mono-2.4.3
>>
>>    In this case, the stack length is more than 1MB (it's ok with less
>>    than
>>    1MB).
>>    My question is: is it possible to force mono-2.6.1 to accept stacks
>>    which are more than 1MB (I've found no related command line option)?
>>
>>    Regards,
>>
>>    Thierry Lafage.
>>
>>    _______________________________________________
>>    Mono-devel-list mailing list
>>    Mono-devel-list at lists.ximian.com
>>    <mailto:Mono-devel-list at lists.ximian.com>
>>
>>    http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100106/db8e7288/attachment.html 


More information about the Mono-devel-list mailing list