Subject: Re: [ast-users] KSH trap segfault question?
--------
> Not sure if this is the correct mailing list for my question, but why does
> this
> cause KSH to segfault?
>
> On ubuntu as a normal user:
> $ function hist {
> > cmd=$(fc -ln -0)
> > print $cmd
> > }
>
> $ trap hist DEBUG
> $ w
> Segmentation fault
>
> On Solaris 10 as a normal user:
> $ function hist {
> > cmd=$(fc -ln -0)
> > print $cmd
> > }
> $ trap hist DEBUG
> trap hist DEBUG
>
> $ ps -ef|grep root|wc -l
> ps -ef|grep root|wc -l
> Segmentation Fault (core dumped)
> -bash-3.00$
>
The core dump is a bug. However, since fc is a built-in alias
this function is being called recursively until it exceeds the
stack size.
I will try to modify the code to output an error message instead.
David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users