This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gh_enter reconsidered



telford@eng.uts.edu.au writes:
> >  > Of course, the Boehm code needs to find the _absolute_ top of the
> >  > stack when possible, while Guile can get away with anything closer
> >  > to the stack bottom than main()'s frame pointer is.
> > 
> > Why is this?
> 
> Paranoia is the only reason.
> 
> There is no way in the world that the user can place data in a higher
> stack frame than main() (unless they use a customised link and ignore libc
> or start inventing their own pointer values) so why bother scanning the
> extra memory just to be conservative?
> 

Not quite - it's possible to put a pointer to a user-allocated string
in environ using putenv or setenv, for instance.


> In my humble opinion, guile should attempt to scan as LITTLE of the
> stack as possible rather than as MUCH as possible. Just do the job that
> has to be done. Make clear to the user that the amount of code they hand
> over into guile's care represents the amount of protection they get but
> GIVE THE USER THE CHOICE.
> 

Do you mean the user has to explicitly ask for stack protection for
ranges he cares about, instead of letting Guile find the top of the
stack? To me that sounds too close to going back to the bad old days
of having to explicilty protect all values on the stack.

 - Maciej