Subject: misc/22089: pmap with /etc/malloc linked to J doesn't work properly.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <maekawa@daemon-systems.org>
List: netbsd-bugs
Date: 07/08/2003 08:18:36
>Number:         22089
>Category:       misc
>Synopsis:       pmap with /etc/malloc linked to J doesn't work properly.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 08 08:19:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     MAEKAWA Masahide
>Release:        1.6U
>Organization:
N/A
>Environment:
NetBSD astaroth.daemon-systems.org 1.6U NetBSD 1.6U (ASTAROTH) #0: Sun Jul  6 16:56:44 JST 2003  maekawa@lucifer.daemon-systems.org:/usr/src/sys/arch/i386/compile/ASTAROTH i386

>Description:
# ln -s -f J /etc/malloc.conf
# pmap 1
pmap: trying to read 72 bytes from d0d0d0d0: kvm_read: Bad address

This messages is output of load_name_cache()@src/usr.bin/pmap/main.c.

void
load_name_cache(kvm_t *kd)
{

...(skip)...

        for (i = 0; i <= nchash; i++) {
                ncpp = &nchashtbl[i]; 
                oncp = NULL;
                LIST_FOREACH(ncp, ncpp, nc_hash) {
                        if (ncp == oncp ||
                            (void*)ncp < kernel_floor ||
                            ncp == (void*)0xdeadbeef)
                                break;
                        oncp = ncp;
                        _KDEREF(kd, (u_long)ncp, &_ncp, sizeof(*ncp)); <=== Here (ncp is 0xd0d0d0d0)
                        ncp = &_ncp;
                        if ((void*)ncp->nc_vp > kernel_floor &&
                            ncp->nc_nlen > 0) {
                                if (ncp->nc_nlen > 2 ||
                                    ncp->nc_name[0] != '.' ||
                                    (ncp->nc_name[1] != '.' &&
                                     ncp->nc_nlen != 1))
                                        cache_enter(i, ncp);
                        }
                }
        }
}

>How-To-Repeat:
# ln -s -f J /etc/malloc.conf
# pmap 1
pmap: trying to read 72 bytes from d0d0d0d0: kvm_read: Bad address

>Fix:
No idea.
>Release-Note:
>Audit-Trail:
>Unformatted: