Subject: 2000 03 07 make(1) seems to have variable parsing problems
To: None <current-users@netbsd.org>
From: Sean Doran <smd@ebone.net>
List: current-users
Date: 06/07/2000 23:20:24
There seems to be variable parsing problems in the latest make.

If DESTDIR is set (/usr/safeplace) and DBG is long (-pipe -O3 -march=i686 
-mfancy-math-387 -fsched-interblock -fsched-spec -fsched-spec-load 
-fbranch-count-reg -fno-expensive-optimizations -fforce-mem -fforce-addr 
-finline-functions -mwide-multiply -funroll-loops), whether set on
the command line or in .mk files, then in /usr/src/share/mk
a make install will fail like so:

crasse# make install
install -r  -c   -o   -g   -m   bsd.README /usr/safeplace/usr/share/mk/bsd.README
install: bsd.README: invalid file mode
*** Error code 1

this is endlessl repeatable

however, this works fine:

crasse# make DBG= install

and, this also works fine:

crasse# make DESTDIR= install

Also, with the long DBG and DESTDIR set, and this:
crasse# ls -l /etc/malloc.conf
lrwxr-xr-x  1 root  wheel  8 Feb  3 02:06 /etc/malloc.conf -> HR>>>>>A

then 
crasse# make includes
...
...
includes ===> gnu/usr.bin/groff/devices/devps
includes ===> gnu/usr.bin/groff/devices/devlj4
make in free(): error: junk pointer, too low to make sense.
Abort trap - core dumped
*** Error code 134

Stop.

repeatably!
crasse# pwd
/usr/src/gnu/usr.bin/groff/devices/devlj4
crasse# make includes
make in free(): error: junk pointer, too low to make sense.
Abort trap (core dumped)
and, more interestingly:
crasse# make DBG= includes
make in free(): error: junk pointer, too low to make sense.
Abort trap (core dumped)
crasse# make DESTDIR= includes
make in free(): error: junk pointer, too low to make sense.
Abort trap (core dumped)
crasse# make DESTDIR= DBG= includes
gdb /usr/obj.i386/usr.bin/make/make
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsd"...(no debugging symbols found)...
(gdb) target core make.core
Core was generated by `make'.
Program terminated with signal 6, Abort trap.
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
#0  0x4810613b in kill ()
(gdb) bt
#0  0x4810613b in kill ()
#1  0x481057c4 in abort ()
#2  0x48103b29 in _tcgetattr ()
#3  0x48105017 in _tcgetattr ()
#4  0x481055d1 in free ()
#5  0x805a248 in Var_Parse ()
#6  0x805b19f in Var_Subst ()
#7  0x8058fe3 in VarLoopExpand ()
#8  0x80590a0 in VarModify ()
#9  0x805a146 in Var_Parse ()
#10 0x805b19f in Var_Subst ()
#11 0x805524a in Parse_File ()
#12 0x8051f75 in ReadMakefile ()
#13 0x8051b53 in main ()
#14 0x80499ca in ___start ()

	Sean.