bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unfinite recursion causes segfault


From: Bruno Haible
Subject: Re: unfinite recursion causes segfault
Date: Tue, 29 Jan 2008 01:04:10 +0100
User-agent: KMail/1.5.4

Aleksey Cheusov wrote:
> By mistake I created a script that runs an unfinite recursion.
> Gawk, instead of handling this situation correctly, just segfaults.

What do you mean by "handling this situation correctly"? If the OS has
limited the amount of available stack memory, all that gawk could do is to
say "fatal error: stack overflow. goodbye!" and terminate.

Gnulib makes it easy to implement such a behaviour, through the c-stack
module [1]. This allows to catch stack overflow on some Unix systems
(Linux, NetBSD, AIX 5, HP-UX, Solaris).

For higher portability, you can also use GNU libsigsegv [2]. It allows to
do catch stack overflow on nearly all systems; including MacOS X and Woe32.

Bruno


[1] http://www.gnu.org/software/gnulib/MODULES.html#module=c-stack
[2] http://www.gnu.org/software/libsigsegv/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]