From owner-freebsd-current Mon Feb 21 11:34: 2 2000 Delivered-To: freebsd-current@freebsd.org Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by hub.freebsd.org (Postfix) with ESMTP id CDA3737B517; Mon, 21 Feb 2000 11:33:52 -0800 (PST) (envelope-from jwd@unx.sas.com) Received: from mozart (mozart.unx.sas.com [192.58.184.28]) by lamb.sas.com (8.9.3/8.9.1) with SMTP id OAA01576; Mon, 21 Feb 2000 14:33:45 -0500 (EST) Received: from bb01f39.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) id AA26958; Mon, 21 Feb 2000 14:33:15 -0500 Received: (from jwd@localhost) by bb01f39.unx.sas.com (8.9.3/8.9.1) id OAA15574; Mon, 21 Feb 2000 14:33:14 -0500 (EST) (envelope-from jwd) From: "John W. DeBoskey" Message-Id: <200002211933.OAA15574@bb01f39.unx.sas.com> Subject: 4.0-current and elm2.4.ME+.68 segv To: freebsd-current@freebsd.org Date: Mon, 21 Feb 2000 14:33:14 -0500 (EST) Cc: ache@freebsd.org X-Mailer: ELM [version 2.4ME+ PL61 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I've been installing 4.0-current and testing it. One of the problems I've found is with the port elm2.4.ME+.68 ... /usr/ports/mail/elm/work/elm2.4.ME+.68/lib/can_open.c function 'can_open()' checks for the presence of the mail folder (which doesn't exist). It returns an appropriate error. Unfortunately, we seem to loose the bad rc. /usr/ports/mail/elm/work/elm2.4.ME+.68/lib/mail_gets.c function 'mail_gets()' is called later with a NULL filepointer which is then passed to feof() and ferror(). Starting "./bin/elm " elm:\elm.c\main 42 > g SIGSEGV - Segmentation violation. elm:\mail_gets.c\mail_gets 31 (+0x6) int mail_gets(buffer, size, mailfile) char *buffer; int size; FILE *mailfile; { register int line_bytes = 0, ch; register char *c = buffer; size--; /* allow room for zero terminator on end, just in case */ 31->>> while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) { ch = getc(mailfile); /* Macro, faster than fgetc() ! */ Note, the above all works correctly if you actually have a valid mail folder. The following patch fixes the problem, though I don't beleive it is truely the correct fix. --- lib/mail_gets.c.orig Fri Jan 21 04:26:05 2000 +++ lib/mail_gets.c Mon Feb 21 14:24:40 2000 @@ -26,6 +26,11 @@ register int line_bytes = 0, ch; register char *c = buffer; + if (!mailfile) { + *c = 0; /* Actually this should NOT be needed.. */ + return line_bytes; + } + size--; /* allow room for zero terminator on end, just in case */ while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) { Thanks, John To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message