From owner-freebsd-questions@FreeBSD.ORG Wed Jun 22 16:16:41 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C14F616A41C for ; Wed, 22 Jun 2005 16:16:41 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CFDB43D55 for ; Wed, 22 Jun 2005 16:16:40 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id j5MGGcUp032051; Wed, 22 Jun 2005 19:16:38 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) by orion.daedalusnetworks.priv (8.13.4/8.13.4) with ESMTP id j5MGGcGb011953; Wed, 22 Jun 2005 19:16:38 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by orion.daedalusnetworks.priv (8.13.4/8.13.4/Submit) id j5MGGbYe011952; Wed, 22 Jun 2005 19:16:37 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 22 Jun 2005 19:16:37 +0300 From: Giorgos Keramidas To: mats.lindberg@se.transport.bombardier.com Message-ID: <20050622161636.GA11708@orion.daedalusnetworks.priv> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-questions@freebsd.org Subject: Re: Generating coredump's from within a signal handler. 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: Wed, 22 Jun 2005 16:16:41 -0000 On 2005-06-22 16:00, mats.lindberg@se.transport.bombardier.com wrote: > I'm writing a program that when receiving a SIGTERM > shall generate a coredump of itself and exit. > This coredump shall be analysed later on using gdb. > I've tried to raise(SIGABRT) when handling SIGTERM, > this generates a coredump, but the stack seems messed > up when examining it with gdb. The stack *is* ``messed up'' when a program runs within a signal handler (where ``messed up'' means signal handlers are not called as normal C functions, but are entered on exit from a system call using special stack magic). What do you see in the gdb backtrace that seems ``messed up''?