Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!jpl From: jpl@allegra.UUCP (John P. Linderman) Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: bug in 4.2 /bin/make Message-ID: <2728@allegra.UUCP> Date: Thu, 23-Aug-84 13:03:19 EDT Article-I.D.: allegra.2728 Posted: Thu Aug 23 13:03:19 1984 Date-Received: Fri, 24-Aug-84 04:44:18 EDT Organization: AT&T Bell Laboratories, Murray Hill Lines: 37 SYSNOPSIS: make sometimes dumps core with a memory fault or segmentation fault REPEAT BY: Turn the following four lines into a makefile, and run make -nd foo:main.o cc main.o -o foo main.o:a/*.h When I do it, I get doname(foo,0) doname(main.o,1) sh: 24665 Memory fault - core dumped Neither the -n nor the -d are essential to generate the dump. The bug seems to depend on the presence of the directory reference in the dependency for main.o. FIX: A quick runthrough with a version of make made with -g revealed that function expand() in file /usr/src/bin/make/doname.c was being invoked with a NULL depname pointer. I didn't dig into the code to determine how the NULL pointer got to expand(), but adding the following check to expand() around lines 282-287 eliminates the core dumping and causes make to operate correctly. --- 282,288 ----- char *s1; struct depblock *p, *srchdir(); + if (q->depname == NULL) return; s1 = q->depname->namep; for(s=s1 ; ;) switch(*s++) { John P. Linderman Break Make Department allegra!jpl