From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21859 invoked by alias); 12 Oct 2007 00:46:25 -0000 Received: (qmail 21850 invoked by uid 22791); 12 Oct 2007 00:46:25 -0000 X-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,TW_FD X-Spam-Check-By: sourceware.org Received: from fgwmail6.fujitsu.co.jp (HELO fgwmail6.fujitsu.co.jp) (192.51.44.36) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Oct 2007 00:46:18 +0000 Received: from m4.gw.fujitsu.co.jp ([10.0.50.74]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id l9C0kFTR030966 for (envelope-from laijs@cn.fujitsu.com); Fri, 12 Oct 2007 09:46:15 +0900 Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 6482B2AC03B for ; Fri, 12 Oct 2007 09:46:15 +0900 (JST) Received: from s7.gw.fujitsu.co.jp (s7.gw.fujitsu.co.jp [10.0.50.97]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 38E6212C080 for ; Fri, 12 Oct 2007 09:46:15 +0900 (JST) Received: from s7.gw.fujitsu.co.jp (s7 [127.0.0.1]) by s7.gw.fujitsu.co.jp (Postfix) with ESMTP id 2AA18161C00C for ; Fri, 12 Oct 2007 09:46:15 +0900 (JST) Received: from vs01.gw.fujitsu.co.jp (vs01.gw.fujitsu.co.jp [133.161.11.21]) by s7.gw.fujitsu.co.jp (Postfix) with ESMTP id CB54F161C008 for ; Fri, 12 Oct 2007 09:46:14 +0900 (JST) Received: from root01.fujitsu.com (root01.fujitsu.com [133.161.11.11]) by vs01.gw.fujitsu.co.jp (8.13.7/8.13.7) with ESMTP id l9C0kEEa031907 for ; Fri, 12 Oct 2007 09:46:14 +0900 Received: from root01.fujitsu.com (root01 [127.0.0.1]) by root01.fujitsu.com (Postfix) with ESMTP id 9CD0B282C6B for ; Fri, 12 Oct 2007 09:46:14 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.105.138]) by root01.fujitsu.com (Postfix) with ESMTP id 3D2A5282C69 for ; Fri, 12 Oct 2007 09:46:14 +0900 (JST) Message-ID: <470EC449.6010106@cn.fujitsu.com> Date: Fri, 12 Oct 2007 00:46:00 -0000 From: Lai Jiangshan User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: systemtap@sourceware.org Subject: Re: [patch] Close fds before execute a cmd References: <470EC324.1010603@cn.fujitsu.com> In-Reply-To: <470EC324.1010603@cn.fujitsu.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00127.txt.bz2 Sorry to make a mistake about the title, it should be "[patch] Restore signals before execute a cmd". Lai Jiangshan wrote: > Hi, all > > case 1: > stap -c 'sleep 100' -e 'probe begin{}' > # killing SIGUSR1 to "sleep 100" does not work as expected > > case 2: > trap "" SIGSEGV # set SIGSEGV's handler as SIG_IGN > stap -c 'sleep 100' -e 'probe begin{}' > # killing SIGSEGV still works. > > The bug reasons of case1 and case2 are same: the signal > handlers are not restored before exec(). > It's not a serious bug, but it's not friendly to users. > This bug can be fixed by the patch below(Restore signals except > SIGINT). > There is also another good way: unblock all signals and > set signals' handlers as SIG_DFL **EXPLICITLY** before exec(). > > Signed-off-by: Lai Jiangshan >