From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 21 14:57:42 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 96E8F16A4BF for ; Thu, 21 Aug 2003 14:57:42 -0700 (PDT) Received: from memphis.mephi.ru (memphis.mephi.ru [194.67.67.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6723B43FE3 for ; Thu, 21 Aug 2003 14:57:41 -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 h7LLvYh9093648 for ; Fri, 22 Aug 2003 01:57:35 +0400 (MSD) (envelope-from timon@memphis.mephi.ru) From: "Artem 'Zazoobr' Ignatjev" To: freebsd-hackers@freebsd.org Content-Type: text/plain Message-Id: <1061503060.1030.4.camel@timon.nist> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 21 Aug 2003 21:57:41 +0000 Content-Transfer-Encoding: 7bit Subject: 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 21:57:42 -0000 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. 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) -- Artem 'Zazoobr' Ignatjev