From owner-freebsd-amd64@FreeBSD.ORG Sat Dec 25 08:19:35 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A538A16A4CE; Sat, 25 Dec 2004 08:19:35 +0000 (GMT) Received: from mail.jrv.org (rrcs-24-73-246-106.sw.biz.rr.com [24.73.246.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 241EF43D31; Sat, 25 Dec 2004 08:19:35 +0000 (GMT) (envelope-from james@jrv.org) Received: from [192.168.3.156] (zippy.housenet.jrv [192.168.3.156]) (authenticated bits=0) by mail.jrv.org (8.12.11/8.12.10) with ESMTP id iBP8JSok006186; Sat, 25 Dec 2004 02:19:29 -0600 (CST) (envelope-from james@jrv.org) Message-ID: <41CD2290.7060001@jrv.org> Date: Sat, 25 Dec 2004 02:19:28 -0600 From: "James R. Van Artsalen" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Archie Cobbs References: <1936407230.20041214120051@bk.ru> <41CBBF53.6020007@jrv.org> <41CC8950.90803@dellroad.org> In-Reply-To: <41CC8950.90803@dellroad.org> Content-Type: multipart/mixed; boundary="------------010805090104080808020407" cc: archie@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: mpd@amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2004 08:19:35 -0000 This is a multi-part message in MIME format. --------------010805090104080808020407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Archie Cobbs wrote: > James R. Van Artsalen wrote: > >> I looked at this and it crashes starting up for me too. It crashes >> in vprintf, within the second call to LogPrintf (), apparently while >> logging ordinary startup messages. I don't see any obvious cause at >> that point unfortunately. > > > Can you try the attached patch? Someone else on the mpd-users mailing > list had a similar problem and this helped. Thanks, it works now. Attached is a slightly different patch. This is against the source currently in ports, and it fixes two additional questionable uses of va_start (). --------------010805090104080808020407 Content-Type: text/plain; name="pat.mpd" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pat.mpd" --- custom.c.~1~ Tue May 4 11:12:28 2004 +++ custom.c Fri Dec 24 17:03:03 2004 @@ -141,16 +141,19 @@ if (!bund) return; - va_start(args, fmt); if (l == NULL) { for (k = 0; k < bund->n_links; k++) { - if (bund && bund->links[k]) + if (bund && bund->links[k]) { + va_start(args, fmt); RecordLinkUpDownReason2(bund->links[k], up, key, fmt, args); + va_end(args); + } } } else { + va_start(args, fmt); RecordLinkUpDownReason2(l, up, key, fmt, args); + va_end(args); } - va_end(args); } static void --- log.c.~1~ Tue May 4 11:12:28 2004 +++ log.c Fri Dec 24 16:42:52 2004 @@ -265,17 +265,21 @@ { va_list args; - va_start(args, fmt); LogTimeStamp(logprintf); + va_start(args, fmt); vlogprintf(fmt, args); + va_end(args); + va_start(args, fmt); vlogprintf("\n", args); /* XXX args will be ignored */ + va_end(args); if (gLogOptions & LG_CONSOLE) { + va_start(args, fmt); vfprintf(stdout, fmt, args); + va_end(args); putc('\n', stdout); fflush(stdout); } - va_end(args); } /* @@ -315,12 +319,16 @@ /* Dump it */ - va_start(ap, fmt); - if (console) + if (console) { + va_start(ap, fmt); LogDoDumpBp(printf, vprintf, FALSE, bp, fmt, ap); - if (log) + va_end(ap); + } + if (log) { + va_start(ap, fmt); LogDoDumpBp(logprintf, vlogprintf, TRUE, bp, fmt, ap); - va_end(ap); + va_end(ap); + } } /* @@ -342,11 +350,16 @@ /* Dump it */ - va_start(ap, fmt); - if (console) + if (console) { + va_start(ap, fmt); LogDoDumpBuf(printf, vprintf, FALSE, buf, count, fmt, ap); - if (log) + va_end(ap); + } + if (log) { + va_start(ap, fmt); LogDoDumpBuf(logprintf, vlogprintf, TRUE, buf, count, fmt, ap); + va_end(ap); + } } /* --- modem.c.~1~ Tue May 4 11:12:28 2004 +++ modem.c Fri Dec 24 17:08:54 2004 @@ -610,10 +610,12 @@ /* Concat prefix and message */ va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); if (*buf != ' ') snprintf(buf, sizeof(buf), "[%s] chat: ", lnk->name); else *buf = '\0'; + va_start(args, fmt); vsnprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), fmt, args); va_end(args); --------------010805090104080808020407--