Subject: kern/21517: 1.6S libkvm / /dev/mem broken?
To: None <gnats-bugs@gnats.netbsd.org>
From: Frank Kardel <kardel@acm.org>
List: netbsd-bugs
Date: 05/10/2003 01:32:50
>Number: 21517
>Category: kern
>Synopsis: 1.6S libkvm / /dev/mem broken? current-20030509-131344
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 09 23:33:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Frank Kardel
>Release: NetBSD 1.6S
>Organization:
>Environment:
System: NetBSD pip 1.6S NetBSD 1.6S (PIP) #3: Fri May 9 23:49:26 MEST 2003 kardel@pip:/fs/IC35L060-0-a/src/NetBSD/netbsd/sys/arch/i386/compile/obj.i386/PIP i386
Architecture: i386
Machine: i386
>Description:
A full install of current-20030509-131344 (kernel+userland) shows all libkvm dependend programs fail like this:
netstat gets into a loop spitting out error messages
pmap: trying to read 8 bytes from c042fe58: kvm_read: Bad address
ktrace of pmap:
1916 ktrace EMUL "netbsd"
1916 ktrace CALL execve(0xbfbfef58,0xbfbff42c,0xbfbff434)
1916 ktrace NAMI "/sbin/pmap"
1916 ktrace RET execve -1 errno 2 No such file or directory
1916 ktrace CALL execve(0xbfbfef58,0xbfbff42c,0xbfbff434)
1916 ktrace NAMI "/usr/sbin/pmap"
1916 ktrace RET execve -1 errno 2 No such file or directory
1916 ktrace CALL execve(0xbfbfef58,0xbfbff42c,0xbfbff434)
1916 ktrace NAMI "/bin/pmap"
1916 ktrace RET execve -1 errno 2 No such file or directory
1916 ktrace CALL execve(0xbfbfef58,0xbfbff42c,0xbfbff434)
1916 ktrace NAMI "/usr/bin/pmap"
1916 ktrace NAMI "/usr/libexec/ld.elf_so"
1916 pmap EMUL "netbsd"
1916 pmap RET execve JUSTRETURN
1916 pmap CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0)
1916 pmap RET mmap -1111564288/0xbdbee000
1916 pmap CALL open(0xbdbfd5c6,0,0xbdbef000)
1916 pmap NAMI "/etc/ld.so.conf"
1916 pmap RET open 3
1916 pmap CALL __fstat13(0x3,0xbfbff324)
1916 pmap RET __fstat13 0
1916 pmap CALL mmap(0,0x37,0x3,0x2,0x3,0,0)
1916 pmap RET mmap -1111568384/0xbdbed000
1916 pmap CALL close(0x3)
1916 pmap RET close 0
1916 pmap CALL munmap(0xbdbed000,0x37)
1916 pmap RET munmap 0
1916 pmap CALL open(0xbdbf1080,0,0)
1916 pmap NAMI "/usr/lib/libkvm.so.5"
1916 pmap RET open 3
1916 pmap CALL __fstat13(0x3,0xbfbff014)
1916 pmap RET __fstat13 0
1916 pmap CALL mmap(0,0x1000,0x1,0x1,0x3,0,0)
1916 pmap RET mmap -1111568384/0xbdbed000
1916 pmap CALL munmap(0xbdbed000,0x1000)
1916 pmap RET munmap 0
1916 pmap CALL mmap(0,0x7000,0x5,0x2,0x3,0,0)
1916 pmap RET mmap -1111592960/0xbdbe7000
1916 pmap CALL mmap(0xbdbed000,0x1000,0x3,0x12,0x3,0,0x5000)
1916 pmap RET mmap -1111568384/0xbdbed000
1916 pmap CALL mmap(0xbdbee000,0,0x3,0x1012,0xffffffff,0,0)
1916 pmap RET mmap -1111564288/0xbdbee000
1916 pmap CALL close(0x3)
1916 pmap RET close 0
1916 pmap CALL open(0xbdbf10c0,0,0xbfbff014)
1916 pmap NAMI "/usr/lib/libc.so.12"
1916 pmap RET open 3
1916 pmap CALL __fstat13(0x3,0xbfbff014)
1916 pmap RET __fstat13 0
1916 pmap CALL mmap(0,0x1000,0x1,0x1,0x3,0,0)
1916 pmap RET mmap -1111597056/0xbdbe6000
1916 pmap CALL munmap(0xbdbe6000,0x1000)
1916 pmap RET munmap 0
1916 pmap CALL mmap(0,0xa8000,0x5,0x2,0x3,0,0)
1916 pmap RET mmap -1112281088/0xbdb3f000
1916 pmap CALL mmap(0xbdbd4000,0x6000,0x3,0x12,0x3,0,0x95000)
1916 pmap RET mmap -1111670784/0xbdbd4000
1916 pmap CALL mmap(0xbdbda000,0xd000,0x3,0x1012,0xffffffff,0,0)
1916 pmap RET mmap -1111646208/0xbdbda000
1916 pmap CALL close(0x3)
1916 pmap RET close 0
1916 pmap CALL getegid
1916 pmap RET getegid 2
1916 pmap CALL getgid
1916 pmap RET getgid 0
1916 pmap CALL setegid(0)
1916 pmap RET setegid 0
1916 pmap CALL __fstat13(0,0xbfbfe7f4)
1916 pmap RET __fstat13 0
1916 pmap CALL __fstat13(0x1,0xbfbfe7e4)
1916 pmap RET __fstat13 0
1916 pmap CALL __fstat13(0x2,0xbfbfe7f4)
1916 pmap RET __fstat13 0
1916 pmap CALL setegid(0x2)
1916 pmap RET setegid 0
1916 pmap CALL __sysctl(0xbfbfe728,0x2,0xbfbfe720,0xbfbfe724,0,0)
1916 pmap RET __sysctl 0
1916 pmap CALL readlink(0xbdbd3340,0xbfbfe7a4,0x3f)
1916 pmap NAMI "/etc/malloc.conf"
1916 pmap RET readlink -1 errno 2 No such file or directory
1916 pmap CALL mmap(0,0x1000,0x3,0x1002,0xffffffff,0,0)
1916 pmap RET mmap -1112285184/0xbdb3e000
1916 pmap CALL break(0x8050cd4)
1916 pmap RET break 0
1916 pmap CALL break(0x8051cd4)
1916 pmap RET break 0
1916 pmap CALL break(0x8052000)
1916 pmap RET break 0
1916 pmap CALL break(0x8053000)
1916 pmap RET break 0
1916 pmap CALL __sysctl(0xbfbfe76c,0x2,0xbdbe62ec,0xbfbfe768,0,0)
1916 pmap RET __sysctl 0
1916 pmap CALL __sysctl(0xbfbfe79c,0x2,0xbdbed701,0xbfbfe798,0,0)
1916 pmap RET __sysctl 0
1916 pmap CALL __stat13(0xbdbed700,0xbfbfe7a4)
1916 pmap NAMI "/netbsd"
1916 pmap RET __stat13 0
1916 pmap CALL open(0xbdbec21c,0,0)
1916 pmap NAMI "/dev/mem"
1916 pmap RET open 3
1916 pmap CALL fcntl(0x3,0x2,0x1)
1916 pmap RET fcntl 0
1916 pmap CALL __fstat13(0x3,0xbfbfe7a4)
1916 pmap RET __fstat13 0
1916 pmap CALL open(0xbdbec25f,0,0)
1916 pmap NAMI "/dev/kmem"
1916 pmap RET open 4
1916 pmap CALL fcntl(0x4,0x2,0x1)
1916 pmap RET fcntl 0
1916 pmap CALL open(0xbdbec225,0,0)
1916 pmap NAMI "/dev/drum"
1916 pmap RET open 5
1916 pmap CALL fcntl(0x5,0x2,0x1)
1916 pmap RET fcntl 0
1916 pmap CALL break(0x8054000)
1916 pmap RET break 0
1916 pmap CALL __stat13(0xbdbec2f2,0xbfbfd664)
1916 pmap NAMI "/var/db/kvm.db"
1916 pmap RET __stat13 0
1916 pmap CALL open(0xbdbec2f2,0,0)
1916 pmap NAMI "/var/db/kvm.db"
1916 pmap RET open 6
1916 pmap CALL fcntl(0x6,0x2,0x1)
1916 pmap RET fcntl 0
1916 pmap CALL read(0x6,0x8053000,0x104)
1916 pmap GIO fd 6 read 260 bytes
"\0\^F\^Ua\0\0\0\^B\0\0\^D\M-R\0\0\^P\0\0\0\0\f\0\0\^A\0\0\0\^A\0\0\0\0\
\b\0\0\0\a\0\0\0\^P\0\0\0f\0\0\0\^?\0\0\0?\0\0\0\M^@\0\0003\M-'\0\0\0\
\^A\M^Un}\M-c\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^D\0\0\0\^D\0\0\0 \0\0\0\
\^O\0\0\0\^\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^X\^A\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1916 pmap RET read 260/0x104
1916 pmap CALL break(0x8055000)
1916 pmap RET break 0
1916 pmap CALL break(0x8056000)
1916 pmap RET break 0
1916 pmap CALL fcntl(0x6,0x2,0x1)
1916 pmap RET fcntl 0
1916 pmap CALL break(0x8057000)
1916 pmap RET break 0
1916 pmap CALL pread(0x6,0x8056000,0x1000,0,0x7000)
1916 pmap GIO fd 6 read 4088 bytes
"\M-z\0\M-}\^O\M-q\^O\M-j\^O\M-^\^O\M-I\^O\M-=\^O\M-1\^O\M-%\^O\M^@\^Ot\
...
\M^OB\M-@_icmpgw\M-@\M-s\M-?\M-=\^F\0\0"
1916 pmap GIO fd 6 read 8 bytes
"\0(\M^M:\M-@_S4"
1916 pmap RET pread 4096/0x1000
1916 pmap CALL break(0x8058000)
1916 pmap RET break 0
1916 pmap CALL pread(0x6,0x8057000,0x1000,0,0x75000)
1916 pmap GIO fd 6 read 4088 bytes
"\M-T\0\M-u\^O\M-i\^O\M-Z\^O\M-N\^O\M-=\^O\M-1\^O\M^^\^O\M^R\^O\M^J\^O~\
...
9\M-@_atapibus_attrs\M-@\M-s\M-?\M-=\^F\0\0\08|9\M-@_eh"
1916 pmap GIO fd 6 read 8 bytes
"ci_attrs"
1916 pmap RET pread 4096/0x1000
1916 pmap CALL pread(0x4,0xbfbfd758,0x33,0,0xc04251a0)
1916 pmap RET pread -1 errno 14 Bad address
#################################### ^^^^^^^^^^^^^^ <<<<<<<<!
1916 pmap CALL issetugid
1916 pmap RET issetugid 1
1916 pmap CALL issetugid
1916 pmap RET issetugid 1
1916 pmap CALL open(0xbdbd20d5,0,0x1b6)
1916 pmap NAMI "/usr/share/nls/nls.alias"
1916 pmap RET open 7
1916 pmap CALL __fstat13(0x7,0xbfbfcc84)
1916 pmap RET __fstat13 0
1916 pmap CALL break(0x805a000)
1916 pmap RET break 0
1916 pmap CALL read(0x7,0x8058000,0x2000)
1916 pmap GIO fd 7 read 1520 bytes
"# $NetBSD: nls.alias,v 1.3 2003/04/14 05:21:51 salo Exp $
#
...
#zh_TW.eucTW zh
"
1916 pmap RET read 1520/0x5f0
1916 pmap CALL read(0x7,0x8058000,0x2000)
1916 pmap RET read 0
1916 pmap CALL close(0x7)
1916 pmap RET close 0
1916 pmap CALL open(0xbfbfd220,0,0xbfbfcd94)
1916 pmap NAMI "/usr/share/nls/C/libc.cat"
1916 pmap RET open 7
1916 pmap CALL __fstat13(0x7,0xbfbfcd84)
1916 pmap RET __fstat13 0
1916 pmap CALL mmap(0,0x101a,0x1,0x1,0x7,0,0)
1916 pmap RET mmap -1112293376/0xbdb3c000
1916 pmap CALL close(0x7)
1916 pmap RET close 0
1916 pmap CALL munmap(0xbdb3c000,0x101a)
1916 pmap RET munmap 0
1916 pmap CALL close(0x6)
1916 pmap RET close 0
1916 pmap CALL open(0xbdbed700,0,0)
1916 pmap NAMI "/netbsd"
1916 pmap RET open 6
1916 pmap CALL fcntl(0x6,0x2,0x1)
1916 pmap RET fcntl 0
1916 pmap CALL getgid
1916 pmap RET getgid 0
1916 pmap CALL setgid(0)
1916 pmap RET setgid 0
1916 pmap CALL pread(0x6,0xbfbfb784,0x20,0,0)
1916 pmap GIO fd 6 read 32 bytes
"\^?ELF\^A\^A\^A\0\0\0\0\0\0\0\0\0\^B\0\^C\0\^A\0\0\0\0\0\^P\M-@4\0\0\0"
1916 pmap RET pread 32/0x20
1916 pmap CALL __fstat13(0x6,0xbfbfe744)
1916 pmap RET __fstat13 0
1916 pmap CALL mmap(0,0x3ad918,0x1,0x2,0x6,0,0)
1916 pmap RET mmap -1116143616/0xbd790000
1916 pmap CALL munmap(0xbd790000,0x3ad918)
1916 pmap RET munmap 0
1916 pmap CALL pread(0x4,0x8050c7c,0x8,0,0xc042fe58)
1916 pmap RET pread -1 errno 14 Bad address
#################################### ^^^^^^^^^^^^^^ <<<<<<<<!
1916 pmap CALL issetugid
1916 pmap RET issetugid 1
1916 pmap CALL issetugid
1916 pmap RET issetugid 1
1916 pmap CALL open(0xbdbd20d5,0,0x1b6)
1916 pmap NAMI "/usr/share/nls/nls.alias"
1916 pmap RET open 7
1916 pmap CALL __fstat13(0x7,0xbfbfdd84)
1916 pmap RET __fstat13 0
1916 pmap CALL read(0x7,0x8053000,0x2000)
1916 pmap GIO fd 7 read 1520 bytes
"# $NetBSD: nls.alias,v 1.3 2003/04/14 05:21:51 salo Exp $
...
#zh_TW.eucTW zh
"
1916 pmap RET read 1520/0x5f0
1916 pmap CALL read(0x7,0x8053000,0x2000)
1916 pmap RET read 0
1916 pmap CALL close(0x7)
1916 pmap RET close 0
1916 pmap CALL open(0xbfbfe320,0,0xbfbfde94)
1916 pmap NAMI "/usr/share/nls/C/libc.cat"
1916 pmap RET open 7
1916 pmap CALL __fstat13(0x7,0xbfbfde84)
1916 pmap RET __fstat13 0
1916 pmap CALL mmap(0,0x101a,0x1,0x1,0x7,0,0)
1916 pmap RET mmap -1112293376/0xbdb3c000
1916 pmap CALL close(0x7)
1916 pmap RET close 0
1916 pmap CALL munmap(0xbdb3c000,0x101a)
1916 pmap RET munmap 0
1916 pmap CALL write(0x2,0xbfbfdeac,0x6)
1916 pmap GIO fd 2 wrote 6 bytes
"pmap: "
1916 pmap RET write 6
1916 pmap CALL write(0x2,0xbfbfdedc,0x3b)
1916 pmap GIO fd 2 wrote 59 bytes
"trying to read 8 bytes from c042fe58: kvm_read: Bad address"
1916 pmap RET write 59/0x3b
1916 pmap CALL write(0x2,0xbfbfdeac,0x1)
1916 pmap GIO fd 2 wrote 1 bytes
"
"
1916 pmap RET write 1
1916 pmap CALL exit(0x1)
>How-To-Repeat:
Build -current and try to use pmap, netstat, systat vm, etc.
>Fix:
check /dev/{k,}mem driver / libkvm.
>Release-Note:
>Audit-Trail:
>Unformatted: