From owner-freebsd-ports Thu Jun 21 23:23:22 2001 Delivered-To: freebsd-ports@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id CE64937B403; Thu, 21 Jun 2001 23:23:15 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 6C42D3E28; Thu, 21 Jun 2001 23:23:15 -0700 (PDT) To: ian j hart Cc: freebsd-ports@freebsd.org, jkh@freebsd.org Subject: Re: New INDEX In-Reply-To: <3B326B5F.C763F5F8@freeloader.freeserve.co.uk>; from ianjhart@freeloader.freeserve.co.uk on "Thu, 21 Jun 2001 22:47:11 +0100" Date: Thu, 21 Jun 2001 23:23:15 -0700 From: Dima Dorfman Message-Id: <20010622062315.6C42D3E28@bazooka.unixfreak.org> Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ian j hart writes: > /stand/sysinstall is core dumping on the new ports/INDEX (r 1.337). The > previous revision is okay (r 1.336). This is using 4.3-RELEASE. Basically what's happening is that some gnome ports have very large lists of dependencies. Sysinstall being the queen of fixed-size buffers, it doesn't deal with this very well. At least the buffer which holds the entire line (index.c::index_parse::line) and the buffer which holds the build dependencies (index.c::index_parse::junk) are being overrun. This causes stack corruption, which leads to the seg fault you're seeing. The attached patch should fix it. I made the buffers larger than they have to be so that this kind of situation won't happen again for a while. Ideally sysinstall would dynamically allocate these buffers; well, no: ideally sysinstall would be replaced by something a bit more modern :-). Dima Dorfman dima@unixfreak.org Index: index.c =================================================================== RCS file: /stl/src/FreeBSD/src/release/sysinstall/Attic/index.c,v retrieving revision 1.80.2.10 diff -u -r1.80.2.10 index.c --- index.c 2001/04/22 16:56:11 1.80.2.10 +++ index.c 2001/06/22 06:17:04 @@ -272,8 +272,8 @@ int index_parse(FILE *fp, char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *cats, char *rdeps) { - char line[2048]; - char junk[511]; + char line[10240]; + char junk[2048]; char *cp; int i; @@ -299,7 +299,7 @@ int index_read(FILE *fp, PkgNodePtr papa) { - char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[1024]; + char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[2048]; PkgNodePtr i; while (index_parse(fp, name, pathto, prefix, comment, descr, maint, cats, deps) != EOF) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message