From owner-freebsd-questions@FreeBSD.ORG Thu Mar 26 20:31:10 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C5FC1065672 for ; Thu, 26 Mar 2009 20:31:08 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout013.mac.com (asmtpout013.mac.com [17.148.16.88]) by mx1.freebsd.org (Postfix) with ESMTP id 18B458FC1D for ; Thu, 26 Mar 2009 20:31:07 +0000 (UTC) (envelope-from cswiger@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from cswiger1.apple.com ([17.227.140.124]) by asmtp013.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KH4006MPRNEDM90@asmtp013.mac.com> for freebsd-questions@freebsd.org; Thu, 26 Mar 2009 13:30:51 -0700 (PDT) Message-id: <458C5AD3-A517-4253-A866-40685A2FC338@mac.com> From: Chuck Swiger To: Ian Rose In-reply-to: <49CBDA39.10409@eecs.harvard.edu> Date: Thu, 26 Mar 2009 13:30:50 -0700 References: <49CBDA39.10409@eecs.harvard.edu> X-Mailer: Apple Mail (2.930.3) Cc: freebsd-questions@freebsd.org Subject: Re: most signals not being delivered to processes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2009 20:31:11 -0000 Hi, Ian-- On Mar 26, 2009, at 12:40 PM, Ian Rose wrote: > I'm new to this list so if this question is better directed > elsewhere please point me in the right direction. Welcome; this list is a good place. > My research group has a server running 7.2-PRERELEASE and an odd > problem has cropped up: most signals are not being delivered to > processes. For example, if I run 'sleep 10' from the shell, ctrl-c > won't interrupt it. kill -KILL still works, but this sort of > makes sense since it involves only the OS and doesn't require > delivery to the process itself. Both your shells and /bin/kill should be using kill(2) system call; see /usr/src/bin/kill/kill.c, /usr/src/contrib/tcsh/sh.proc.c, etc for the details. For a signal to work, the OS does deliver it to the process, which must be in a runnable state or else delivery will block until the process has returned from a system call or whatever is blocking it. > I have performed a fairly extensive series of tests: > > using bash: > > * ctrl-c does nothing > * ctrl-z does nothing > * kill -XXX works for SIGKILL and SIGSTOP only > * kill -XXX does nothing for all other signals > * a C program does not receive a SIGHUP, SIGINT, SIGABRT or > SIGTERM that it has sent to itself via 'kill(getpid(), SIGxxx)' > * a C program will react appropriately when it sends itself a > SIGKILL or SIGSTOP > * a C program will react appropriately when you call abort(3) > * a C program will die with the error "Floating point exception: > 8 (core dumped)" if it divides by zero, but not if it sends itself a > SIGFPE. That's significantly odd. What does "stty -a" say about your control character settings? You should see something like: % stty -a speed 9600 baud; 58 rows; 90 columns; [ ... ] cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; eol2 = ; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; ...which has the mappings for ^C => SIGINT, ^Z => SIGTSTP, etc. Regards, -- -Chuck