csup in repomirror mode dumps core @ stable/8

jhell jhell at DataIX.net
Sun Sep 5 10:24:27 UTC 2010


-----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 at 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-----
-------------- next part --------------
#! /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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: builddbglibs.sh.sig
Type: application/octet-stream
Size: 287 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20100905/76479508/builddbglibs.sh.obj


More information about the freebsd-stable mailing list