Lubomir Rintel wrote:

> Bash Version: 4.0
> Patch Level: 10
> Release Status: release
> 
> Description:
>       If the heredoc input is terminted with end-of-file by pressing ^D
>       while history is on, bash enters an infinite loop (due to NULL
>       dereference along with a rather sick SIGSEGV handling, which will
>       probably be subject to a subsequent patch).

The SIGSEGV just needs to be handled immediately, the problem of doing
"too much" in a signal handler be damned:

*** ../bash-4.0-patched/sig.c   2009-01-04 14:32:41.000000000 -0500
--- sig.c       2009-03-21 14:31:30.000000000 -0400
***************
*** 449,452 ****
--- 449,457 ----
       int sig;
  {
+   /* If we get called twice with the same signal before handling it,
+      terminate right away. */
+   if (sig == terminating_signal)
+     terminate_immediately = 1;
+
    terminating_signal = sig;


Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/


Reply via email to