From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Wed, 13 Aug 1997 17:32:26 -0400 Received: from clark.net (root@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id NAA08324; Wed, 13 Aug 1997 13:57:43 -0400 (EDT) Received: from clark.net (culliton@localhost [127.0.0.1]) by clark.net (8.8.5/8.7.1) with ESMTP id NAA29765; Wed, 13 Aug 1997 13:57:41 -0400 (EDT) Message-Id: <199708131757.NAA29765@clark.net> To: Tim Goodwin cc: Tom Culliton , rc@hawkwind.utcs.toronto.edu Subject: Re: rc,linux,signal,readline In-reply-to: Your message of "Wed, 13 Aug 1997 14:33:53 BST." Date: Wed, 13 Aug 1997 13:57:41 -0400 From: Tom Culliton On Wed, 13 Aug 1997 14:33:53 BST, Tim Goodwin wrote: > ...and it all seems to work ok. Specifically, INTs and QUITs work as I > expect. Can you let me know what to look for so I can fix it? OK, testing with 1.5b2 out of the box configured --with-readline, "make trip" hangs in trip.rc somewhere after line 411. This is RedHat 4.2, and according to ldd, with the same dynamic libraries as you were using. The following sequence shows a problem with catching signals using readline. [root@cnslab3 rc-1.5b2]# ./rc ; kill -1 $pid Hangup Looks, OK.... [root@cnslab3 rc-1.5b2]# [root@cnslab3 rc-1.5b2]# [root@cnslab3 rc-1.5b2]# ./rc ; fn sighup {echo "Got sighup"} ; kill -1 $pid [root@cnslab3 rc-1.5b2]# ./rc ; fn sighup {echo "Got sighup"} ; kill -1 $pid Hangs and has to be "kill -9"ed I went through this at great length a few months back and came up with a set of patches that do the required clean up after readline. The archives should contain the very detailed messages that I sent to the mailing list describing my discoveries and diagnoses. In summary, readline catches certain signals and resets the terminal state, however there are many more that it doesn't catch, and one (SIGWINCH) that it handles in a rather odd way. When you handle one of these signals within rc instead of exiting, things are left in a bad state. It's probably to be expected that the place where trip.rc hangs is while waiting for a subshell to return, i.e. - catching SIGCHLD. I will try to adapt the patches to 1.5b2 and forward them to you.