|
From: | Paul Eggert |
Subject: | Re: Avoid C stack overflow |
Date: | Thu, 13 Mar 2014 10:57:33 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 03/13/2014 09:42 AM, Dmitry Antipov wrote:
What about an attempt to avoid such a mess by examining current C stack depth and check it against system limits, like suggested in the patch below?
Don't most systems solve the problem with guard pages these days? If so, Emacs should just rely on these pages, as that shouldn't require slowing down Ffuncall etc. And if not, if memory management is available Emacs could install a guard page of its own, again without slowing down the main interpreter loop.
Also, the code as given won't work on systems that have split stacks (e.g., gcc -fsplit-stack), and would need to be ported to them.
How about the following idea instead? Assume that there are guard pages, and have Emacs trap the resulting signal and do the right thing.
[Prev in Thread] | Current Thread | [Next in Thread] |