Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2001 14:39:32 -0800 (PST)
From:      David Wolfskill <david@catwhisker.org>
To:        current@FreeBSD.ORG, null@pozo.com
Cc:        mikeh@FreeBSD.ORG, obrien@FreeBSD.ORG
Subject:   Re: New mail dumps core on current
Message-ID:  <200112192239.fBJMdWU46508@bunrab.catwhisker.org>
In-Reply-To: <5.1.0.14.2.20011219135833.00af0c60@pozo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Wed, 19 Dec 2001 14:07:28 -0800
>From: Manfred Antar <null@pozo.com>

>mail dumps core on current with latest /usr/src/usr.bin/mail updates:

Yeah; I was able to reproduce that result.

I then re-made mail, this time with the -g flag, and tried again;
problem is detected in fixhead() (send.c:419).

Running it under gdb, I see some weird stuff happening (or maybe I'm
just confused).  Here's the first part of fixhead():

/*
 * Fix the header by glopping all of the expanded names from
 * the distribution list into the appropriate fields.
 */
void
fixhead(hp, tolist)
	struct header *hp;
	struct name *tolist;
{
	struct name *np;

	hp->h_to = NULL;
	hp->h_cc = NULL;
	hp->h_bcc = NULL;
	for (np = tolist; np != NULL; np = np->n_flink)
		/* Don't copy deleted addresses to the header */
		if (np->n_type & GDEL)
			continue;
		if ((np->n_type & GMASK) == GTO)


The failure is on the first conditional in the for loop.  Watch this:

freebeast[22] gdb `which mail`
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(gdb) b fixhead
Breakpoint 1 at 0x80545af: file /usr/src/usr.bin/mail/send.c, line 419.
(gdb) set args -v david
(gdb) r
Starting program: /usr/bin/mail -v david
Subject: Test 3
??!!!!?
.
Cc: 

Breakpoint 1, fixhead (hp=0xbfbff808, tolist=0x805f000)
    at /usr/src/usr.bin/mail/send.c:419
419     {
(gdb) p hp
$1 = (struct header *) 0x805f000
(gdb) p tolist
$2 = (struct name *) 0x1
(gdb) n
422             hp->h_to = NULL;
(gdb) p hp
$3 = (struct header *) 0xbfbff808
(gdb) p tolist
$4 = (struct name *) 0x805f000
(gdb) 



OK, I realize that "constants aren't; variables won't," but this is getting
a bit much.  Is, perhaps, something screwy happening with the stack pointer
(or some such thing; it's been ~8 years since I looked at the insides of
gcc)?

Cheers,
david
-- 
David H. Wolfskill				david@catwhisker.org
I believe it would be irresponsible (and thus, unethical) for me to advise,
recommend, or support the use of any product that is or depends on any
Microsoft product for any purpose other than personal amusement.

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




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