Subject: bin/10333: make pointer lossage causes bad behaviour
To: None <gnats-bugs@gnats.netbsd.org>
From: None <smd@ebone.net>
List: netbsd-bugs
Date: 06/09/2000 15:08:27
>Number:         10333
>Category:       bin
>Synopsis:       make pointer lossage causes bad behaviour
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 09 15:09:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Sean Doran
>Release:        anoncvs at 2000 06 09
>Organization:
Sean Doran <smd@ebone.net>
Development Manager, Ebone Inc., Copenhagen Denmark
>Environment:
	
System: NetBSD sean.ebone.net 1.4Z NetBSD 1.4Z (EBONE) #9: Sat Jun 3 22:14:26 CEST 2000 smd@sean.ebone.net:/usr/src/sys/arch/i386/compile/EBONE i386


>Description:
	make frees things it shouldn't
	make dumps complains in gnusrc/usr.bin/groff/devices/devlj4 when 
	  MALLOC_OPTIONS contains 'H' and dumps core when it contains 'HA'
	make behaves badly in /usr/src/share/mk when DESTDIR is set and DBG
	  contains many optimization options
>How-To-Repeat:
	fresh sources, fresh make no earlier than 2000 06 07
	
crasse# pwd
/usr/src/gnu/usr.bin/groff/devices/devlj4
crasse# setenv MALLOC_OPTIONS H
crasse# make
make in free(): warning: junk pointer, too low to make sense.
make in free(): warning: junk pointer, too low to make sense.
make in free(): warning: junk pointer, too low to make sense.
crasse# setenv MALLOC_OPTIONS HA
crasse# make
make in free(): error: junk pointer, too low to make sense.
Abort trap (core dumped)

2.

crasse# make build
Build started at: Sat Jun 10 00:02:48 CEST 2000
(cd /usr/src/etc && make distrib-dirs)
install  -d -o root -g wheel -m 755 /usr/safeplace
mtree -def mtree/NetBSD.dist -p /usr/safeplace/ -u
cd /usr/safeplace; rm -f sys; ln -s usr/src/sys sys
(cd /usr/src/share/mk && 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

Stop.
*** Error code 1

crasse# cd /usr/share/mk; grep DBG *
sys.mk:DBG?=    "-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"
sys.mk:DBG?=    -O
sys.mk:CFLAGS?= ${DBG}
crasse# cd /usr/src/share/mk
crasse# setenv DESTDIR /usr/safepalce
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

Stop.
crasse# make DBG=-O install | head -4
install -r  -c   -o root  -g wheel  -m 444  bsd.README /usr/safeplace/usr/share/mk/bsd.README
install -r  -c   -o root  -g wheel  -m 444  bsd.crypto.mk /usr/safeplace/usr/share/mk/bsd.crypto.mk
install -r  -c   -o root  -g wheel  -m 444  bsd.doc.mk /usr/safeplace/usr/share/mk/bsd.doc.mk
install -r  -c   -o root  -g wheel  -m 444  bsd.dep.mk /usr/safeplace/usr/share/mk/bsd.dep.mk

Note that only in this directory does the value of DBG= make difference
to a make build of -current userland.

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: