[Mono-dev] Stack size with mono-2.6.1

Miguel de Icaza miguel at ximian.com
Thu Jan 7 12:51:17 EST 2010


Hello

    Ah, thanks for the explanation!

> Hello,
> 
> In fact, I'm working on a gcc backend which generates CIL code (from
> C): gcc4cli. We use the cbenchmark suite to evaluate the performance
> of our backend, and in this suite there is C code which is not really
> clean; one of the benchs declares a big table in a local variable
> which we translate into CIL stack data.
> 
> Thierry Lafage.
> 
> 
> Miguel de Icaza a écrit : 
> > Hello,
> > 
> >     I am curious, why does the Main method need 1 megabyte of IL stack?
> > 
> >   
> > > 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
> > > > 
> > > > 
> > > >       
> > 
> >   



More information about the Mono-devel-list mailing list