From owner-freebsd-hackers Fri Aug 17 1:18:38 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (dialmess.nanolink.com [217.75.135.246]) by hub.freebsd.org (Postfix) with SMTP id 20C0537B403 for ; Fri, 17 Aug 2001 01:18:29 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 11692 invoked by uid 1000); 17 Aug 2001 08:16:57 -0000 Date: Fri, 17 Aug 2001 11:16:57 +0300 From: Peter Pentchev To: brian o'shea Cc: Hans Zaunere , freebsd-hackers@FreeBSD.ORG Subject: Re: Signal Handling Message-ID: <20010817111657.B556@ringworld.oblivion.bg> Mail-Followup-To: brian o'shea , Hans Zaunere , freebsd-hackers@FreeBSD.ORG References: <20010814152536.B27553@netapp.com> <20010815024750.21433.qmail@web12802.mail.yahoo.com> <20010814211158.A22386@netapp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010814211158.A22386@netapp.com>; from boshea@netapp.com on Tue, Aug 14, 2001 at 09:11:58PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Aug 14, 2001 at 09:11:58PM -0700, brian o'shea wrote: > On Tue, Aug 14, 2001 at 07:47:50PM -0700, Hans Zaunere wrote: > > > [...] > > > > 2) If a 10k binary is running, the signal is sent, and the program > > > > is reloaded from disk, but is 100k (or 1k even) how does the > > > > signal handling function get called, taking into account what > > > > Stevens says. Steven states that the sigmask remains for calls > > > > across exec, so wouldn't the wrong address to the handler function > > > > be used? > > > > > > No, the signal mask is not the address of the handler function. It > > > is the bit mask which determines which signals are blocked. > > > > > > > Sorry, I think I miss spoke myself. If a signal handler is setup in > > the running process, and exec is called, replacing the same program, > > but this time, the program is much smaller or bigger, will the signal > > handler function be in the right place? The same program is exec'd, > > but since it's a different size, won't the signal handler function > > pointer, point to the wrong place? > > If a program calls exec on the file that is the current text file (i.e. > argv[0]), then the text segment of the process will be the same size as > it was before the call to exec, because it will be identical. The only > reason why the process' size might (and probably will) be different is > because of any dynamically allocated memory, and because of and stack > growth from function calls and local variable allocation. Neither of > these effect the address of any of the functions in the program > (including the signal handlers). This is not necessarily true; a program might exec() a file by the same name, but with different contents - e.g. restarting a recompiled server. G'luck, Peter -- I've heard that this sentence is a rumor. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message