NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

unable to use lsof on NetBSD 5



Hi,

is anyone using sysutils/lsof on NetBSD/i386 version 5?

Both with the GENERIC kernel from NetBSD 5.0.1 and with a MONOLITHIC
kernel (built like MONOLITHIC from -current) of the netbd-5 branch
(updated today) I get:

  # lsof
  lsof: kvm_openfiles(execfile=/dev/ksyms, corefile=/dev/mem): Device not
  configured

  # ls -al /dev/ksyms /dev/mem
  cr--r--r--  1 root  wheel  101, 0 Oct 30 19:20 /dev/ksyms
  crw-r-----  1 root  kmem     2, 0 Oct 30 19:20 /dev/mem

  # strings //netbsd5.0.1.GENERIC | sed -n 's/^_CFG_//p' | unvis | fgrep -i 
ksyms
  pseudo-device   ksyms                   # /dev/ksyms

I get this behaviour for lsof-4.78.5.0.1nb5 from pkgsrc-2009Q3 and
with a locally created package.

Output of ktruss is

   497      1 ktruss   emul(netbsd)
   497      1 ktruss   fktrace                     = 0
   497      1 ktruss   fcntl(0x4, 0x3, 0)          = 1
   497      1 ktruss   fcntl(0x4, 0x4, 0x1)        = 0
   497      1 ktruss   execve("/sbin/lsof", 0xbfbfe96c, 0xbfbfe974) Err#2 ENOENT
   497      1 ktruss   execve("/usr/sbin/lsof", 0xbfbfe96c, 0xbfbfe974) Err#2 
ENOENT
   497      1 ktruss   execve("/bin/lsof", 0xbfbfe96c, 0xbfbfe974) Err#2 ENOENT
   497      1 ktruss   execve("/usr/bin/lsof", 0xbfbfe96c, 0xbfbfe974) Err#2 
ENOENT
   497      1 lsof     emul(netbsd)
   497      1 lsof     execve("/usr/pkg/sbin/lsof", 0xbfbfe96c, 0xbfbfe974) 
JUSTRETURN
   497      1 lsof     mmap(0, 0x8000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 
0xbbbe9000
   497      1 lsof     open("/usr/libexec/ld.elf_so", 0, 0) Err#2 ENOENT
   497      1 lsof     open("/etc/ld.so.conf", 0, 0) = 3
   497      1 lsof     __fstat30(0x3, 0xbfbfe178)  = 0
   497      1 lsof     mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbbe8000
   497      1 lsof     munmap(0xbbbe8000, 0x1000)  = 0
   497      1 lsof     mmap(0, 0x7000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbbbe2000
   497      1 lsof     mmap(0xbbbe8000, 0x1000, 0x3, 0x12, 0x3, 0, 0x6000, 0) = 
0xbbbe8000
   497      1 lsof     mmap(0xbbbe9000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 
0xbbbe9000
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     open("/usr/lib/libkvm.so.5", 0, 0xbfbfe178) = 3
   497      1 lsof     __fstat30(0x3, 0xbfbfe178)  = 0
   497      1 lsof     mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbbe1000
   497      1 lsof     munmap(0xbbbe1000, 0x1000)  = 0
   497      1 lsof     mmap(0, 0xf0000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbbaf2000
   497      1 lsof     mmap(0xbbbca000, 0x8000, 0x3, 0x12, 0x3, 0, 0xd7000, 0) 
= 0xbbbca000
   497      1 lsof     mmap(0xbbbd2000, 0x10000, 0x3, 0x1012, 0xffffffff, 0, 0, 
0) = 0xbbbd2000
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     open("/usr/lib/libc.so.12", 0, 0xbfbfe178) = 3
   497      1 lsof     __fstat30(0x3, 0xbfbfe178)  = 0
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     __sysctl(0xbfbfe8a0, 0x2, 0xbbbe09c0, 0xbfbfe8a8, 0, 0) 
= 0
   497      1 lsof     getrlimit(0x8, 0xbfbfe778)  = 0
   497      1 lsof     close(0x3)                  Err#9 EBADF
   497      1 lsof     close(0x4)                  = 0
   497      1 lsof     close(0x5)                  Err#9 EBADF
   ......
   497      1 lsof     close(0x7e)                 Err#9 EBADF
   497      1 lsof     close(0x7f)                 Err#9 EBADF
   497      1 lsof     open("/lib/libc.so.12", 0x2, 0) = 3
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     umask(0)                    = 18
   497      1 lsof     issetugid()                 = 1
   497      1 lsof     getpid()                    = 497, 1008
   497      1 lsof     getgid()                    = 0, 2
   497      1 lsof     getegid()                   = 2
   497      1 lsof     geteuid()                   = 0
   497      1 lsof     getuid()                    = 0
   497      1 lsof     __sysctl(0xbfbfe358, 0x2, 0xbbbd9fd4, 0xbfbfe360, 0, 0) 
= 0
   497      1 lsof     __sysctl(0xbfbfe298, 0x2, 0xbbbe0e20, 0xbfbfe2a0, 0, 0) 
= 0
   497      1 lsof     readlink("/dev/null", 0xbfbfe365, 0x400) Err#2 ENOENT
   497      1 lsof     break(0x8100000)            = 0
   497      1 lsof     mmap(0, 0x100000, 0x3, 0x14001002, 0xffffffff, 0, 0, 0) 
= 0xbb900000
   497      1 lsof     __stat30("/etc/malloc.conf", 0xbfbfe8a4) = 0
   497      1 lsof     __sysctl(0xbfbfe774, 0x2, 0xbfbfe734, 0xbfbfe77c, 0, 0) 
= 0
   497      1 lsof     open("/dev", 0, 0)          = 3
   497      1 lsof     fcntl(0x3, 0x2, 0x1)        = 0
   497      1 lsof     __fstat30(0x3, 0xbfbfe6dc)  = 0
   497      1 lsof     open("/dev/mem", 0, 0)      = 4
   497      1 lsof     fcntl(0x4, 0x2, 0x1)        = 0
   497      1 lsof     open("/dev/kmem", 0, 0)     = 5
   497      1 lsof     fcntl(0x5, 0x2, 0x1)        = 0
   497      1 lsof     open("/dev/drum", 0, 0)     Err#6 ENXIO
   497      1 lsof     issetugid()                 = 1
   497      1 lsof     issetugid()                 = 1
   497      1 lsof     open("/dev/ksyms", 0, 0xbfbfd8a4) Err#2 ENOENT
   497      1 lsof     open("/usr/share/nls/nls.alias.db", 0, 0xbfbfd908) = 6
   497      1 lsof     fcntl(0x6, 0x2, 0x1)        = 0
   497      1 lsof     __fstat30(0x6, 0xbfbfd898)  = 0
   497      1 lsof     mmap(0, 0x5f0, 0x1, 0x2, 0x6, 0, 0, 0) = 0xbbaf1000
   497      1 lsof     close(0x6)                  = 0
   497      1 lsof     munmap(0xbbaf1000, 0x5f0)   = 0
   497      1 lsof     open("/usr/share/nls/nls.alias", 0, 0xbfbfdd28) = 6
   497      1 lsof     __fstat30(0x6, 0xbfbfdd28)  = 0
   497      1 lsof     mmap(0, 0x10be, 0x1, 0x1, 0x6, 0, 0, 0) = 0xbbaf0000
   497      1 lsof     close(0x6)                  = 0
   497      1 lsof     munmap(0xbbaf0000, 0x10be)  = 0
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     close(0x4)                  = 0
   497      1 lsof     close(0x5)                  = 0
   497      1 lsof     issetugid()                 = 1
   497      1 lsof     issetugid()                 = 1
   497      1 lsof     open("/usr/share/nls/C/libc.cat", 0, 0xc) Err#2 ENOENT
   497      1 lsof     open("/usr/share/nls/nls.alias.db", 0, 0xbfbfda58) = 3
   497      1 lsof     fcntl(0x3, 0x2, 0x1)        = 0
   497      1 lsof     __fstat30(0x3, 0xbfbfd9e8)  = 0
   497      1 lsof     mmap(0, 0x5f0, 0x1, 0x2, 0x3, 0, 0, 0) = 0xbbaf1000
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     munmap(0xbbaf1000, 0x5f0)   = 0
   497      1 lsof     open("/usr/share/nls/nls.alias", 0, 0xbfbfde78) = 3
   497      1 lsof     __fstat30(0x3, 0xbfbfde78)  = 0
   497      1 lsof     mmap(0, 0x10be, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbaf0000
   497      1 lsof     close(0x3)                  = 0
   497      1 lsof     munmap(0xbbaf0000, 0x10be)  = 0
   497      1 lsof     write(0x2, 0xbfbfdfc0, 0x53) = 83
       "lsof: kvm_openfiles(execfile=/dev/ksyms, corefile=/dev/mem): Device n"
   497      1 lsof     exit(0x1)

ciao
     Klaus


Home | Main Index | Thread Index | Old Index