On 08/28/2014 12:02 PM, bogun.dmit...@gmail.com wrote: > IMHO any user action should not lead to SIGSEGV! I am not objecting against > recursive "sourse" itself. But when I got SIGSEGV from "bash", I have no > idea why this is happened. I have made recursive "sourse" by mistake and > spend a lot of time looking up what exactly lead to SIGSEGV.
SIGSEGV is what happens on stack overflow, unless you integrate a stack overflow detector like GNU libsigsegv with your sources to catch the segv and replace it with a nice error message. As to whether or not user code should be able to cause stack overflow, we can't prevent it. Reliably preventing stack overflow would be equivalent to solving the Halting Problem, which we cannot do; so all we can do is detect when it happens. > > Put a configurable limit on the deep of recursive source. There is almost > no variant for legal usage of recursive source on deep... 10000 for > example. If someone need such recursion deep, he alway can raise limit or > turn it off by setting it to 0. The GNU Coding Standards state that GNU software cannot have arbitrary limits by default. Any limit we pick, other than unlimited (your proposal of turning it to 0), would be an arbitrary limit for someone who has a machine with more memory and a larger stack. So 0 is the only sane default, but that's no different than what we already have. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature