From owner-freebsd-questions@FreeBSD.ORG Thu Aug 26 08:45:09 2004 Return-Path: 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 4EF8416A4CE for ; Thu, 26 Aug 2004 08:45:09 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id D76E843D45 for ; Thu, 26 Aug 2004 08:45:07 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i7Q8j1tq099026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Aug 2004 09:45:01 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i7Q8j0Wf099019; Thu, 26 Aug 2004 09:45:00 +0100 (BST) (envelope-from matthew) Date: Thu, 26 Aug 2004 09:45:00 +0100 From: Matthew Seaman To: Gerard Seibert Message-ID: <20040826084500.GA87719@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Gerard Seibert , Francis GUDIN , FreeBSD Question References: <200408241903.03275.gerard-seibert@rcn.com> <20040825182516.0767.GERARD-SEIBERT@rcn.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: <20040825182516.0767.GERARD-SEIBERT@rcn.com> User-Agent: Mutt/1.5.6i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (smtp.infracaninophile.co.uk [IPv6:::1]); Thu, 26 Aug 2004 09:45:01 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040705, clamav-milter version 0.74a on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: Francis GUDIN cc: FreeBSD Question Subject: Re: Error When Attempting to Use portmanager X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 08:45:09 -0000 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 25, 2004 at 06:30:17PM -0400, Gerard Seibert wrote: > OK, I am not that knowledgable about compiling programs, etc. Exactly how > do I recompile with ("-g" flag on cc). Does this cause it to get a > backtrace? If not, then how do I go about it? To compile a program from ports with '-g' you should be able to use the CFLAGS make variable from /etc/make.conf (ideally, you should be able to override it from the environment or the command line and avoid having to fiddle with that file at all, but YMMV). Taking portmanager as t= he example: # cd /usr/ports/sysutils/portmanager # make clean # make CFLAGS=3D'-g -O' all This will leave you with a copy of the portmanager executable in ${WRKDIRPREFIX}/sysutils/portmanager/work/portmanager-0.2.0/portmanager (${WRKDIRPREFIX} will be /usr/ports, unless you've deliberately changed it) % file portmanager=20 portmanager: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD= ), for FreeBSD 4.9.1, dynamically linked (uses shared libs), not stripped That 'not stripped' part is important: it means that this copy of the executable contains all of the debug symbols the '-g' puts in. However, if you go ahead and install the port, all of those symbols will be stripped out -- debug symbols generally take up a huge amount of space, and that's a waste unless you are actually debugging things. All is not lost though: go ahead and install the portmanager port, and do whatever it was that you did which caused it to dump core. Do *not* run 'make clean' in the port directory. You should have a file portmanager.core To obtain a stack trace with useful information, run: # gdb ${WRKDIRPREFIX}/sysutils/portmanager/work/portmanager-0.2.0/portm= anager/portmanager -c portmanager.core (ie. tell gdb to use the unstripped copy of the program, and match it against the core dump.) Then when it has loaded all of the symbols etc., type: > where Cut'n'paste that output into your e-mail report to the developers, but make sure you keep the corefile and the unstripped version of portmanager to hand, as you may well be asked to run some other gdb(1) commands to extract further information. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (FreeBSD) iD8DBQFBLaMMiD657aJF7eIRAubrAJ0QyEzesg0j4arOv0r1oRf0zyVbXACfcI3c oBp1AeKH7F9IEw3xBFNLY1w= =teI+ -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5--