It's possible to make bash locked up. It's done by bad signal handling
in bash and/or readline. It may happened when bash/readline catch signal
in any alloc call. I have changed readline to process signals only in
safe point. This appears also in bash-4. I will attach a small
reproducer (normally it's nearly impossible to reproduce this bug. With
this reproducer patch you can hit ctrl-r and then ctrl-c to see bash
locked up) and patch which fix this bug.
--- bash-3.2/lib/readline/isearch.c-orig 2009-01-09 08:08:05.000000000
+0100
+++ bash-3.2/lib/readline/isearch.c 2009-01-09 08:17:00.000000000 +0100
@@ -220,7 +220,9 @@ _rl_isearch_init (direction)
/* Allocate space for this many lines, +1 for the current input line,
and remember those lines. */
+{int xc; cxt->lines = NULL; for (xc = 0; xc < 30000000; xc++) { xfree
(cxt->lines);
cxt->lines = (char **)xmalloc ((1 + (cxt->hlen = i)) * sizeof (char *));
+}}
for (i = 0; i < cxt->hlen; i++)
cxt->lines[i] = hlist[i]->line;