From owner-freebsd-stable@FreeBSD.ORG Sun Sep 5 10:24:27 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8FEB10656B3 for ; Sun, 5 Sep 2010 10:24:27 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id E45988FC08 for ; Sun, 5 Sep 2010 10:24:26 +0000 (UTC) Received: by iwn34 with SMTP id 34so3639238iwn.13 for ; Sun, 05 Sep 2010 03:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=oX+yvLYD1BvcGMhyQSYC4mg3EFD2PkCga5K7ELcFiMY=; b=rGFd3fl7ZHAZPxBxbUzsKweH9KMApRXN5FsguNFwZgVyqopzrUMFKxcGb+XI4yMOUW VIKGzeJhRhZuTZbG3+JWF1tc1KlrJs6Q17JJ0oP1SIXejjg+WLohMaWT99gPMxlzgAJN vELs1tgWIHOLjWYvGLbLLPIz5dIzW9p7VeLxY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=yIADxfmcfhBNXIWAEBlQK+r2YlSminBBZhW5yFKwdC/+Cytfoz99wmSj9D/emENWu0 r+yR6ZXqDwfKop+6Zb8gOhSDbvuw/d1hkPFdqpkJsIR/XgaN3nazrQsieZrLf2oK1lu+ sE4P8YCsJcJF1gCb58HrUUlTrNrDJ7/C0qXmI= Received: by 10.231.193.11 with SMTP id ds11mr3743548ibb.192.1283682266054; Sun, 05 Sep 2010 03:24:26 -0700 (PDT) Received: from centel.dataix.local (adsl-99-181-137-20.dsl.klmzmi.sbcglobal.net [99.181.137.20]) by mx.google.com with ESMTPS id z6sm4434660ibc.6.2010.09.05.03.24.23 (version=SSLv3 cipher=RC4-MD5); Sun, 05 Sep 2010 03:24:24 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C836FD6.5040200@DataIX.net> Date: Sun, 05 Sep 2010 06:24:22 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100806 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Jeremy Chadwick References: <20100902055630.GA55668@zibbi.meraka.csir.co.za> <20100902061656.GA29424@icarus.home.lan> In-Reply-To: <20100902061656.GA29424@icarus.home.lan> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------030405040708020004050605" Cc: mux@freebsd.org, lulf@freebsd.org, stable@freebsd.org, Dmitry Morozovsky Subject: Re: csup in repomirror mode dumps core @ stable/8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 10:24:27 -0000 This is a multi-part message in MIME format. --------------030405040708020004050605 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/02/2010 02:16, Jeremy Chadwick wrote: > On Thu, Sep 02, 2010 at 07:56:31AM +0200, John Hay wrote: >> On Thu, Sep 02, 2010 at 03:59:07AM +0400, Dmitry Morozovsky wrote: >>> Dear colleagues, >>> >>> some 2 days ago my repo mirror (stable/8@amd64) starts dumping >>> core on copying repo: >>> >>> ... SetAttrs CVSROOT-src/Emptydir Edit CVSROOT-src/access,v >>> Segmentation fault (core dumped) >>> >>> deleting files from sup/cvsroot-all/ did not help >>> >>> unfortunately, quick usual `make -DDEBUG_FLAGS=-g' in >>> /usr/src/usr.bin/csup does not work, and I did not dig into this >>> deeply yet, so trace are without parameters: > > This won't work. You need to do: make DEBUG_FLAGS="-g3 -ggdb -O0" > > The important part is not using -D. make.conf variables aren't > exported into the compiler environment (I'm not phrasing this > eloquently because I don't know how to describe it). The rest of the > gcc arguments I provided are highly recommended (especially -O0, > otherwise you probably won't get access to any variable data). > > I can confirm this works, by the way. Look closely at the cc line > (past the initial -O2 -pipe -march=nocona). > > cc -O2 -pipe -march=nocona -I. > -I/usr/src/usr.bin/csup/../../contrib/csup -DHAVE_FFLAGS -DNDEBUG > -ggdb -g3 -O0 -std=gnu99 -fstack-protector -Wsystem-headers -Werror > -Wno-pointer-sign -c > /usr/src/usr.bin/csup/../../contrib/csup/updater.c > Not being picky but just wanted to let you know that the flags specified to DEBUG_FLAGS that you have listed above are perfectly fine but for those without the knowledge of how this is done, the last flag specified is usually the flag that wins. So for DEBUG_FLAGS="-g3 -ggdb -O0" the -ggdb flag would be the debugging type of ELF binary produced making the '-g3' flag just redundant. Now in case you wanted the effect of '-g3' and '-ggdb' you can specify '-ggdb3' instead. As for the compile that was listed above it seems as if the flags were reorganized in some way leading to '-g3' ultimately taking the cake. Irregardless you will still end up with a binary that can be debugged by gdb(1)/kgdb(1) either way. Attached is a script that I use after buildworld installworld to rebuild libthr and libc that is helpful for debugging that you may or may not find useful. Regards, - -- jhell,v -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMg2/VAAoJEJBXh4mJ2FR+0k4H/RhffEPOsykY777HLm+PgSxF EGmXHGDO/E3q3SRwcq062wLqa3r6sEcFh3claXamNRyCCsMvzvOEo/id77GA9lGe SMlJGjsI8WyA0ZZl9SonsFN9bU4KFS2OfCzXBpUHbdDBZ0huaLlJNOq41HBxv55B MSqTxfOXWUANZ2zzDiuKwdtY+MwiXwEwj8nJV0SAryGjcwEZoC/34nZfHCF2Y/uU sKVhrZmzg/jbXxVtDuFfJ5uhk9UoLRWeAf0huUpfZJ6k7FtzjL4pP/EEMPyJhGtK fVNYiOuQr9ZAErRg27LDgfT/fKwffbONeYQ9Q0osV44GYcateO5RhBdA7UEEAxE= =fmjo -----END PGP SIGNATURE----- --------------030405040708020004050605 Content-Type: text/plain; name="builddbglibs.sh" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="builddbglibs.sh" #! /bin/sh LIBDIR="/usr/src/lib" DBGLIBS="libc libthr" DBGFLAGS="-g3 -O0" TARGETS="obj depend includes" NUMCPUS=$((($(sysctl -n kern.smp.cpus)*2)+(10))) for dbglib in $DBGLIBS; do for target in $TARGETS; do make -C $LIBDIR/$dbglib $target DEBUG_FLAGS="${DBGFLAGS}" done nice make -C $LIBDIR/$dbglib DEBUG_FLAGS="${DBGFLAGS}" && make -C $LIBDIR/$dbglib install DEBUG_FLAGS="${DBGFLAGS}" done --------------030405040708020004050605 Content-Type: application/octet-stream; name="builddbglibs.sh.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="builddbglibs.sh.sig" iQEcBAABAgAGBQJMg2/VAAoJEJBXh4mJ2FR+/MsH/j3CCxGK+5ceDH2iUcV7S1GRfMcty1pj QhSCIgiOdC/3s8/mQymJ5DxI/zKL/slxRW/czg9x5fUHx++tlJ61pwh+GrnMaa1Lm6fYbsvL /xzpVs8FfDzQb7fCKTlqq8VCFThzON/JR+7aJd4lbhj4I7nUXpXpPT39WOiy+2x1/qMNFkAo p601NbmwTMdTS8q389tA3pZJqS4d+P41GKuADIzptjF9eHtW/lDcxUoPuXnw/6xq0Z09C3+R mWqxfz/aeEJWQzZNZm6tSxBzDhyb2fAQ0GjW3jrSMCmtcTZvt24E14NWCw23/YC/aTqmy8B3 D3u/+5mDIrv6Ybaj+8C5sNw= --------------030405040708020004050605--