🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #60

GNU Make version 3.62 bug

#60
From: Markus Armbruster
Date: Tue, 03 Nov 1992 16:39
60 lines
1889 bytes
Dear Roland,

The following Makefile causes GNU Make version 3.62 on a Sun-4 to dump
core:

all : nothing

/one/% :: /two/%
	echo gnu

/three/% :: /four/%
	echo gnat

The bug is in rule.c, function count_implicit_rule_limits ().  This
function iterates along a list, rule points to the current list node,
lastrule to the previous one except at the list's head, where lastrule
== rule (freerule () depends on this fact!).  After unlinking the
first list node from the list, this condition does not hold.  If you
try to unlink the second one, too, freerule aborts.  Quick fix:

>diff -u rule.c~ rule.c
--- rule.c~	Wed Aug  7 23:32:00 1991
+++ rule.c	Tue Nov  3 15:03:09 1992
@@ -108,8 +108,17 @@
 		{
 		  if (*name == '/')
 		    {
-		      freerule (rule, lastrule);
-		      rule = lastrule;
+		      if (pattern_rules == rule)
+			{
+			  freerule (rule, lastrule);
+			  rule = lastrule = pattern_rules;
+			}
+		      else
+			{
+			  freerule (rule, lastrule);
+			  lastrule = rule;
+			  rule = rule->next;
+			}
 		      goto end_main_loop;
 		    }
 		  else
@@ -121,9 +130,9 @@
       if (ndeps > max_pattern_deps)
 	max_pattern_deps = ndeps;
 
-    end_main_loop:;
       lastrule = rule;
       rule = rule->next;
+    end_main_loop:;
     }
   
   if (name != 0)


Hope, this helps improving an already very good program.

Kind regards,
	Markus
Technical Details
Message-ID: <9211031439.AA10071@hel>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!cs.uoregon.edu!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!karlsruhe.gmd.DE!armbru

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!cs.uoregon.edu!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!karlsruhe.gmd.DE!armbru
From: armbru@karlsruhe.gmd.DE (Markus Armbruster)
Newsgroups: gnu.utils.bug
Subject: GNU Make version 3.62 bug
Message-ID: <9211031439.AA10071@hel>
Date: 3 Nov 92 16:39:01 GMT
Article-I.D.: hel.9211031439.AA10071
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 60
Approved: bug-gnu-utils@prep.ai.mit.edu