From: Raymond T. <to...@rt...> - 2002-02-26 21:58:28
|
>>>>> "Bruno" == Bruno Haible <ha...@il...> writes: >> Assume that the end of stack is unwriteable memory and that's how >> stack overflow is detected. Make the actual stack somewhat smaller >> than the allocated space Bruno> Problem 1: How do you know where the stack ends? You can call My comment was based on not knowing exactly how clisp stack is implemented. I'm obviously clueless. Bruno> getrlimit, but this gives only an upper estimate, because the environ Bruno> and (on HP-UX) also the shared libraries are allocated on the stack. How does that work? (HP-UX shared libs on the stack?) >> and make the extra space unwriteable. Bruno> Problem 2: mprotecting stack space is totally unportable. Bruno> Forget about this approach. Such hacks (frequently seen in CMUCL) are Bruno> what makes CMUCL and MIT-Scheme hard to port. I thought mprotect was on of the easier parts of CMUCL. It's telling CMUCL the instruction set and the C APIs, and fixed mmap addresses, and sigcontext layout and.... that was hard. :-) Bruno> Better look what you else can do with the sigsegv.h.in interface. Or Bruno> find a totally different way to exploit the sigaltstack() system Bruno> call, which becomes more and more supported. Or use GNU pth in order Bruno> to create a new stack when the previous one was insufficient. Well, this is beyond me. I can't even get the avcall and ffcall stuff to work with gcc 3.x. (Yes, I know about just ignoring avcall errors. I can't get past the ffcall errors though.) Ray |