Skip site navigation (1)Skip section navigation (2)
Date:      29 Jul 1998 11:01:37 +0200
From:      smoergrd@oslo.geco-prakla.slb.com (Dag-Erling Coidan Smørgrav)
To:        Jerry Hicks <jhicks@glenatl.glenayre.com>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/7393: du throws SIGSEGV whenever '-c' option is used (at du.c:226)
Message-ID:  <rx4pvepyqry.fsf@oslo.geco-prakla.slb.com>
In-Reply-To: Jerry Hicks's message of Tue, 28 Jul 1998 20:20:02 -0700 (PDT)
References:  <199807290320.UAA25039@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jerry Hicks <jhicks@glenatl.glenayre.com> writes:
>  Indeed, I confirmed with Dag-Colin that /etc/malloc.conf -> AJ on the
                            ---------
Uh, no. :) Erling, as in "Little Earl".

>  savedp is assigned a value only if the loop started at du.c:186 and then
>  only at the following line, where it is assigned the value of 'p' which
>  comes from the 'fts_read()' function call.

I checked that in your core dump; savedp contains a valid address, but
the data at that addrress is uninitialized. The SIGSEGV occurs when
the -c flag is set and du tries to dereference savedp->fts_parent
which is garbage (0xd0d0d0d0 if you have malloc.conf set to J)

>  Ordinarily I would expect a compiler diagnostic to complain about the
>  use of a possibly uninitialized variable ( fts_read() could return NULL
>  the first time through? )

Possibly, yes.

>  Off to study fts_read() & Co.

AOL.

DES
-- 
Dag-Erling Smørgrav - smoergrd@oslo.geco-prakla.slb.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?rx4pvepyqry.fsf>