NetBSD Problem Report #37684

From martin@duskware.de  Thu Jan  3 20:46:28 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8CC9163B8A2
	for <gnats-bugs@gnats.netbsd.org>; Thu,  3 Jan 2008 20:46:28 +0000 (UTC)
Message-Id: <20080103203536.D776463B852@narn.NetBSD.org>
Date: Thu,  3 Jan 2008 20:35:36 +0000 (UTC)
From: gbr@voidland.org
Reply-To: gbr@voidland.org
To: netbsd-bugs-owner@NetBSD.org
Subject: make dies if the dependecies of a target are too many and/or too long
X-Send-Pr-Version: www-1.0

>Number:         37684
>Category:       toolchain
>Synopsis:       make dies if the dependecies of a target are too many and/or too long
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 03 20:50:00 +0000 2008
>Closed-Date:    Sun Nov 23 13:35:29 +0000 2008
>Last-Modified:  Sun Nov 23 18:20:01 +0000 2008
>Originator:     Vladimir Panov
>Release:        4.0
>Organization:
>Environment:
NetBSD netbsd.voidland.org 4.0 NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:20:10 PST 2007  builds@wb34:/home/builds/ab/netbsd-4-0-RELEASE/i386/200712160005Z-obj/home/builds/ab/netbsd-4-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386
>Description:
make dies with a segmentation fault if the dependencies of a target comprise a string which is longer than (approximately) 64 K (spaces, new lines and continuation backslashes included). This error did not exist in NetBSD 3.


>How-To-Repeat:
Create a makefile of the kind:

target: dep1 ... \
    ... \
    depn

which is bigger than 64 KB. The files target, dep1, ..., depn may not exist. Run make on this makefile.
>Fix:

>Release-Note:

>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/37684: make dies if the dependecies of a target are too many and/or too long
Date: Thu, 3 Jan 2008 22:10:47 +0000

 On Thu, Jan 03, 2008 at 08:50:00PM +0000, gbr@voidland.org wrote:
 > >Number:         37684
 > >Category:       toolchain
 > >Synopsis:       make dies if the dependecies of a target are too many and/or too long
 > >Description:
 > make dies with a segmentation fault if the dependencies of a target comprise a string which is longer than (approximately) 64 K (spaces, new lines and continuation backslashes included). This error did not exist in NetBSD 3.
 > 
 > 
 > >How-To-Repeat:
 > Create a makefile of the kind:
 > 
 > target: dep1 ... \
 >     ... \
 >     depn
 > 
 > which is bigger than 64 KB. The files target, dep1, ..., depn may not exist.

 make does use realloc() to extend the buffer it uses to hold a single
 source line.  The initial size is 32k, so the extension to 64k is ok (and
 I'd tested it), so something subtle must be going wrong whe it tries to
 extend it to 96k.

 make in netbsd 3 used a different scheme for reading makefile which
 dominated the file parsing time.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: David Laight <dsl@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/37684 CVS commit: src/usr.bin/make
Date: Thu,  3 Jan 2008 22:14:54 +0000 (UTC)

 Module Name:	src
 Committed By:	dsl
 Date:		Thu Jan  3 22:14:53 UTC 2008

 Modified Files:
 	src/usr.bin/make: parse.c

 Log Message:
 When we extend the buffer used to read makefiles (in order to read lines
 longer than 32k) remember the new length so we DTRT for lines longer than 64k.
 Should fix PR/37684


 To generate a diff of this commit:
 cvs rdiff -r1.142 -r1.143 src/usr.bin/make/parse.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Sun, 23 Nov 2008 13:35:29 +0000
State-Changed-Why:
Fixed some time ago, pullup now requested for netbsd-4 (bug not in netbsd-3).


From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/37684 CVS commit: [netbsd-4] src/usr.bin/make
Date: Sun, 23 Nov 2008 18:17:04 +0000 (UTC)

 Module Name:	src
 Committed By:	bouyer
 Date:		Sun Nov 23 18:17:04 UTC 2008

 Modified Files:
 	src/usr.bin/make [netbsd-4]: parse.c

 Log Message:
 Pull up following revision(s) (requested by dsl in ticket #1239):
 	usr.bin/make/parse.c: revision 1.143
 When we extend the buffer used to read makefiles (in order to read lines
 longer than 32k) remember the new length so we DTRT for lines longer than 64k.
 Should fix PR/37684


 To generate a diff of this commit:
 cvs rdiff -r1.120.2.3 -r1.120.2.4 src/usr.bin/make/parse.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.