Subject: weirdness with install(1)
To: None <current-users@NetBSD.ORG>
From: Jason Thorpe <thorpej@OG.ORG>
List: current-users
Date: 10/13/1997 11:31:58
Hi folks...

Updating the world on my hp300, and I'm seeing a _STRANGE_ problem with
install(1), that I don't quite understand.

I get an:

install: /usr/lib/ bad address

...constantly.  Every time.  The error comes from the call to write()
in the mmap() case of copy().  Gdb tells me:

gdb) run -c -o bin -g bin -m 444 /usr/src/lib/libc/obj.hp300/ /us
Starting program: /work/netbsd/src/usr.bin/xinstall/obj.hp300/xinstall -c -o bin -g bin -m 444 /usr/src/lib/libc/obj.hp300/ /usr/lib/

Breakpoint 1, copy (from_fd=7, 
    from_name=0xffeff829 "/usr/src/lib/libc/obj.hp300/", to_fd=6, 
    to_name=0xffeff853 "/usr/lib/", size=0x0000000000060806)
    at /work/netbsd/src/usr.bin/xinstall/xinstall.c:421
421             if (size <= 8 * 1048576) {
(gdb) step
422                     if ((p = mmap(NULL, (size_t)size, PROT_READ,
425                     if (write(to_fd, p, size) != size)
(gdb) print/x p
$1 = 0x4084000
(gdb) step
426                             err(1, "%s", to_name);
(gdb) print/x p
$2 = 0xffffffff

Note the local variable is getting stomped on!  I'm not sure where/how
this is happening.

Has anyone seen anything like this on their -current system, and, if so,
what did you do to fix it?  This has me somewhat perplexed, and a bit
annoyed, since I need to make binary snapshots for the 1.3 release cycle...


        -- Jason R. Thorpe <>