From owner-ctm-users@FreeBSD.ORG Mon Jan 19 19:03:31 2004 Return-Path: Delivered-To: ctm-users@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B816A16A4CE for ; Mon, 19 Jan 2004 19:03:31 -0800 (PST) Received: from sccimhc02.asp.att.net (sccimhc02.asp.att.net [63.240.76.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6348543D2F for ; Mon, 19 Jan 2004 19:03:30 -0800 (PST) (envelope-from stephen@math.missouri.edu) Received: from math.missouri.edu (12-216-240-169.client.mchsi.com[12.216.240.169]) by sccimhc02.asp.att.net (sccimhc02) with ESMTP id <20040120030329im2006b30le>; Tue, 20 Jan 2004 03:03:29 +0000 Message-ID: <400C9A7C.1000508@math.missouri.edu> Date: Mon, 19 Jan 2004 21:03:24 -0600 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040117 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ctm-users@freebsd.org References: <20040119082251.GA2708@server.vk2pj.dyndns.org> In-Reply-To: <20040119082251.GA2708@server.vk2pj.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: CTM problem X-BeenThere: ctm-users@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CTM User discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 03:03:31 -0000 Peter Jeremy wrote: > CTM seems to have died sometime after 2004-Jan-17 0055 UTC - the > last delta mailed or available via FTP is cvs-cur.9944.gz > I did some analysis of the problem. It looks like there will need to be some rewriting of mkctm.c. I could try to do it myself, but if someone else wants to do it, that would be better. I have no idea how long it will take me to do. In fact, I am not exactly sure what the problem is. It is probably somehow related to the fact that mkctm needs to use about 200M of memory. The problem is when mkctm is comparing the file ports/INDEX,v in the old and new directories. These files are getting to about 60 to 70MB in size. mkctm contains a function called Equ. First Equ does a mmap to map each of the files to memory, so that it can compare them to see if they are the same size. If they are different, Equ then attempts to use alloca to allocate memory of the same size as the larger of the two files (plus 2). This memory is then used to store the output of "diff -n". It is during this call to alloca that mkctm has a segmentation fault. Thus the program needs to allocate about 3 times 60 or 70MB. I am not at all familiar with how FreeBSD allocates memory. I see from the man page that alloca gets its memory from the stack. I am guessing that mmap gets its memory from the heap, but I am not sure. I remember working with these kinds of problems before. I know that there is a command to change how much space processes are allowed to use, but I don't remember the commands for this right now. Maybe someone could remind me what they are, and in that case maybe just increasing the stack allowed by processes would fix the problem. In any case, fixing this problem is definitely stretching my Unix/BSD knowledge, so any help I can get would be greatly appreciated. Best, Stephen