From hsn@netmag.cz  Thu Feb 26 10:56:59 2004
Return-Path: <hsn@netmag.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5D34416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Feb 2004 10:56:59 -0800 (PST)
Received: from mail.tiscali.cz (stateless1.tiscali.cz [213.235.135.70])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9294143D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Feb 2004 10:56:58 -0800 (PST)
	(envelope-from hsn@netmag.cz)
Received: from asura.bsd (212.11.96.247) by mail.tiscali.cz (6.7.021)
        id 40292FFD0032F08E for FreeBSD-gnats-submit@freebsd.org; Thu, 26 Feb 2004 19:56:56 +0100
Received: from hsn@localhost
	by asura.bsd (Exim 4.24_4 FreeBSD) id 1AwPHm-0000JY-Uh
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Feb 2004 18:26:58 +0100
Message-Id: <E1AwPHm-0000JY-Uh@asura.bsd>
Date: Thu, 26 Feb 2004 18:26:58 +0100
From: Radim Kolar <hsn@netmag.cz>
Reply-To: Radim Kolar <hsn@netmag.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: make dumps core
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63405
>Category:       bin
>Synopsis:       make dumps core
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 26 11:00:33 PST 2004
>Closed-Date:    Thu Jun 10 13:08:54 GMT 2004
>Last-Modified:  Thu Jun 10 13:08:54 GMT 2004
>Originator:     Radim Kolar
>Release:        FreeBSD 5.2-RELEASE-p2 i386
>Organization:
Bhagavata Dharma
>Environment:
System: FreeBSD asura.bsd 5.2-RELEASE-p2 FreeBSD 5.2-RELEASE-p2 #2: Sun Feb 8 16:07:05 CET 2004 root@asura.bsd:/usr/src/sys/i386/compile/GENERIC i386
>Description:
Hey your make turtlility dumps core with my makefiles!
>How-To-Repeat:
Basic makefile:
=======
include ../Makefile

PACKAGE=scache
LOGIN=hsn@scache.sf.net
WHERE=/home/groups/s/sc/scache/htdocs/

# DO NOT DELETE THIS LINE -- make depend depends on it.
articles.wml : macros.wml leftmenu.wml
download.wml : macros.wml leftmenu.wml
features.wml : macros.wml leftmenu.wml
index.wml : macros.wml leftmenu.wml
list.wml : macros.wml leftmenu.wml
logo.wml : macros.wml leftmenu.wml
macros.wml : leftmenu.wml
ss_filter.wml : macros.wml leftmenu.wml
ss_offline.wml : macros.wml leftmenu.wml
ss_running.wml : macros.wml leftmenu.wml
ss_ui.wml : macros.wml leftmenu.wml
======
Makefile in upper directory:
======
TARFILE=$(PACKAGE)-sfweb.tar.gz
SNAPSHOT=$(HOME)/web/$(PACKAGE)-web.snar

pages:  *.html

allupdate:
	cd scache && $(MAKE) update
	cd scloader && $(MAKE) update
	cd dmachine && $(MAKE) update
	cd fspclient && $(MAKE) update
	cd fsp && $(MAKE) update

fullupload:
	if [ -z "$(SNAPSHOT)" ]; then false;fi
	rm -f $(SNAPSHOT)
	$(MAKE) upload

view:  pages
	w3m index.html

update:
	$(MAKE) upload
	$(MAKE) unpack

upload: pages
	if [ -z "$(LOGIN)" -o -z "$(WHERE)" -o -z "$(TARFILE)" -o -z "$(SNAPSHOT)" ]; then false;fi
	rm -f $(SNAPSHOT).new
	-cp -a $(SNAPSHOT) $(SNAPSHOT).new
	tar cvzf /tmp/$(TARFILE) -h --exclude '*.bak' --listed-incremental=$(SNAPSHOT).new .
	scp /tmp/$(TARFILE) $(LOGIN):$(WHERE)
	mv $(SNAPSHOT).new $(SNAPSHOT)
	rm -f /tmp/$(TARFILE)

unpack:
	if [ -z "$(LOGIN)" -o -z "$(WHERE)" -o -z "$(TARFILE)" ]; then false;fi
	ssh $(LOGIN) "cd $(WHERE);tar xzvf $(TARFILE);rm $(TARFILE)"

.wml.html:
	wml $<
%.wml :
	touch $@
.SUFFIXES: .wml .html
.PHONY:  all pages fullupload upload unpack view
.DEFAULT:
=========
install them both and type make.
>Fix:
>Release-Note:
>Audit-Trail:

From: Chris Pressey <cpressey@catseye.mine.nu>
To: freebsd-gnats-submit@FreeBSD.org, hsn@netmag.cz
Cc:  
Subject: Re: bin/63405: make dumps core
Date: Mon, 15 Mar 2004 16:06:48 -0800

 This is a multi-part message in MIME format.
 
 --Multipart=_Mon__15_Mar_2004_16_06_48_-0800_K5uBXaHLgD87mT7a
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 This problem is exhibited on FreeBSD 4.9 as well.  It appears to stem
 from a NULL pointer dereference.  Please review the attached patch.
 
 -Chris
 
 --Multipart=_Mon__15_Mar_2004_16_06_48_-0800_K5uBXaHLgD87mT7a
 Content-Type: text/plain;
  name="suff.c.diff"
 Content-Disposition: attachment;
  filename="suff.c.diff"
 Content-Transfer-Encoding: 7bit
 
 --- suff.c.orig	Thu Mar  8 17:13:24 2001
 +++ suff.c	Mon Mar 15 16:02:16 2004
 @@ -379,7 +379,12 @@
      Lst l;
      Suff *s;
  {
 -    LstNode ln = Lst_Member(l, (ClientData)s);
 +    LstNode ln;
 +
 +    if (s == NULL)
 +	return;
 +
 +    ln = Lst_Member(l, (ClientData)s);
      if (ln != NILLNODE) {
  	Lst_Remove(l, ln);
  	s->refCount--;
 @@ -683,12 +688,14 @@
  	 * We'll be called twice when the next target is seen, but .c and .o
  	 * are only linked once...
  	 */
 -	SuffRemove(t->children, s);
 +	if (t != NULL)
 +		SuffRemove(t->children, s);
  
  	/*
  	 * Remove the target from the source's parents list
  	 */
 -	SuffRemove(s->parents, t);
 +	if (s != NULL)
 +		SuffRemove(s->parents, t);
      } else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) {
  	printf("transformation %s complete\n", gn->name);
      }
 
 --Multipart=_Mon__15_Mar_2004_16_06_48_-0800_K5uBXaHLgD87mT7a--
Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue Mar 16 00:47:04 PST 2004 
Responsible-Changed-Why:  
I will look after it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63405 
State-Changed-From-To: open->patched 
State-Changed-By: ru 
State-Changed-When: Mon Apr 12 13:05:32 PDT 2004 
State-Changed-Why:  
Fixed in 5.2-CURRENT, in src/usr.bin/make/suff.c,v 1.29. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63405 
State-Changed-From-To: patched->closed 
State-Changed-By: ru 
State-Changed-When: Thu Jun 10 13:08:15 GMT 2004 
State-Changed-Why:  
Fixed in 4.10-STABLE, in src/usr.bin/make/suff.c,v 1.12.2.2. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63405 
>Unformatted:
