Date: Sun, 05 Sep 2010 06:24:22 -0400 From: jhell <jhell@DataIX.net> To: Jeremy Chadwick <freebsd@jdc.parodius.com> Cc: mux@freebsd.org, lulf@freebsd.org, stable@freebsd.org, Dmitry Morozovsky <marck@rinet.ru> Subject: Re: csup in repomirror mode dumps core @ stable/8 Message-ID: <4C836FD6.5040200@DataIX.net> In-Reply-To: <20100902061656.GA29424@icarus.home.lan> References: <alpine.BSF.2.00.1009020351080.66062@woozle.rinet.ru> <20100902055630.GA55668@zibbi.meraka.csir.co.za> <20100902061656.GA29424@icarus.home.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C836FD6.5040200>