From owner-freebsd-questions Wed Sep 11 12:30:30 2002 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 16C6037B400 for ; Wed, 11 Sep 2002 12:30:26 -0700 (PDT) Received: from smtp3.acsu.buffalo.edu (smtp3.acsu.buffalo.edu [128.205.6.86]) by mx1.FreeBSD.org (Postfix) with SMTP id 1CF3E43E3B for ; Wed, 11 Sep 2002 12:30:25 -0700 (PDT) (envelope-from cd9@buffalo.edu) Received: (qmail 25871 invoked from network); 11 Sep 2002 19:30:23 -0000 Received: from ubppp234-112.dialin.buffalo.edu (HELO selvirjin.buffalo.edu) (128.205.234.112) by smtp3.acsu.buffalo.edu with SMTP; 11 Sep 2002 19:30:23 -0000 Received: from dragon by selvirjin.buffalo.edu with local (Exim 3.36 #1) id 17pDBG-000062-00; Wed, 11 Sep 2002 15:29:42 -0400 Date: Wed, 11 Sep 2002 15:29:42 -0400 From: "C. A. Daelhousen" To: sroberts@dsl.pipex.com, FreeBSD Questions Subject: Re: Can I safely delete this? Message-ID: <20020911152942.A335@selvirjin.buffalo.edu> Mail-Followup-To: sroberts@dsl.pipex.com, FreeBSD Questions References: <1030190969.379.3.camel@Demon.vickiandstacey.com> <20020824101445.A211@selvirjin.alltel.net> <20020911170811.GB93658@pacer.dmz.smartrafficenter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020911170811.GB93658@pacer.dmz.smartrafficenter.org>; from kpieckiel@smartrafficenter.org on Wed, Sep 11, 2002 at 01:08:11PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At approximately Wed, Sep 11, 2002 at 01:08:11PM -0400, Kevin A. Pieckiel scribbled: > On Sat, Aug 24, 2002 at 10:14:45AM -0400, C. A. Daelhousen wrote: > > On Sat, Aug 24, 2002 at 01:09:28PM +0100, Stacey Roberts wrote: > > > I see this in my ~ dir: > > > -rw------- 1 23461888 Aug 1 22:39 opera.core > > > > > > Can I safely delete this file? > > > > > > > Probably. Core files occur when you get a crash, and are only useful > > for debugging. You can change the name it drops with the kern.corefile > > sysctl, or disable them with kern.coredump. > > > > If you're really paranoid, run "file ~/opera.core" first to make sure > > it's really a core file. It should say something like: > > > > /usr/home/foo/opera.core: ELF 32-bit LSB core file (signal 4477762), > > Intel 80386, version 1 (FreeBSD), from 'opera' > > > > Note: The signal number is bogus, because the magic for that is tuned > > for Linux. > > "Tuned for Linux?" What, was this utility adopted from Linux or something? > Looking at the man page, file(1) has been around since v6, although FreeBSD's version apparently hasn't. I traced through the magic file and a couple of cores one night, and it fits Linux core files perfectly. FreeBSD uses a different core format, so you get the bogus signal number. The number is the four bytes "\0DSB", which comes from the tail of a "FreeBSD" string being converted to a 32-bit int, little endian style. (This is referring to the platform I use, which is i386.) The official ELF specification says "the content of core files is not defined". I guess what the magic ought to do is check for a "FreeBSD" string somewhere, and use a different offset to find the signal number in that case. PR 41107 is about this. http://www.freebsd.org/cgi/query-pr.cgi?pr=misc/41107 -- ..: Chad Daelhousen == cd9@buffalo.edu :.........: sig v3.1 :... : Programming for 10 +/- 2 years (50 +/- 10% of a lifetime) : :.............Perl will be the first to implement mind reading.: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message