From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 21 15:07:36 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D102F16A4BF for ; Thu, 21 Aug 2003 15:07:36 -0700 (PDT) Received: from memphis.mephi.ru (memphis.mephi.ru [194.67.67.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id A000143FF7 for ; Thu, 21 Aug 2003 15:07:35 -0700 (PDT) (envelope-from timon@memphis.mephi.ru) Received: from [192.168.0.3] (ppp8-235.pppoe.mtu-net.ru [81.195.8.235]) (authenticated bits=0) by memphis.mephi.ru (8.12.6p2/8.12.6) with ESMTP id h7LM7Wh9094125; Fri, 22 Aug 2003 02:07:33 +0400 (MSD) (envelope-from timon@memphis.mephi.ru) From: "Artem 'Zazoobr' Ignatjev" To: Lev Walkin In-Reply-To: <3F454218.4010209@netli.com> References: <1061503060.1030.4.camel@timon.nist> <3F454218.4010209@netli.com> Content-Type: text/plain Message-Id: <1061503658.1030.8.camel@timon.nist> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 21 Aug 2003 22:07:39 +0000 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Dumping a core from inside of process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2003 22:07:37 -0000 At Thu, 21.08.2003, 22:05, Lev Walkin wrote: > Artem 'Zazoobr' Ignatjev wrote: > > Hello, hackers > > > > I'm writing some program, which dlopens() a lot of shared objects, and > > can do nasty things to it's own memory. Some day I decided to trap fatal > > memory signals, like SIGILL, SIGBUS and SIGSEGV, and wrote a handler for > > these, which swears with bad words into syslog, dlcloses() all that > > objects, and quits. > > What if a handler dlcloses() something which is already in process of > dlclosing() at the time the handler fires? No, that's the only place (except normal shutdown sequence) where the object can be dlcosed() > > > But today I found that it's very useful - to have coredump handy, since > > its eases debug a lot. What is the (correct) way to make a coredump of > > your own memory (and, it'll be nice to have all that stack frames and > > registers written as they were when the signal did occured, not what > > they were when we are already in signal handler) > > man 3 abort thanks, I'll take a look -- Artem 'Zazoobr' Ignatjev