NetBSD-Bugs archive

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

kern/48422: Possible recvmmsg/sendmmsg implementation problem



>Number:         48422
>Category:       kern
>Synopsis:       Possible recvmmsg/sendmmsg implementation problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 03 04:05:00 +0000 2013
>Originator:     Dustin Marquess
>Release:        6.6.28
>Organization:
>Environment:
NetBSD bobdole.fdf.net 6.99.28 NetBSD 6.99.28 (BOBDOLE) #0: Thu Nov 28 22:40:55 
UTC 2013  
root%bobdole.fdf.net@localhost:/usr/src/sys/arch/amd64/compile/BOBDOLE amd64
>Description:
nsd 4.0 from net/nsd goes into a infinite loop when recvmmsg/sendmmsg support 
is enabled (which it is, by default).  When disabling that (by passing 
--disable-recvmmsg to its configure), it works fine.  The same code seems to 
work on Linux, so I'm assuming that either this is a problem with the NetBSD 
implementation, or that nsd is using it wrong but in a way that just happens to 
work on Linux.

ktruss output:

  2538      1 nsd      __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0
  2538      1 nsd      emul(netbsd)
  2538      1 nsd      __gettimeofday50(0x7f7fffffd6d0, 0) = 0
  2538      1 nsd      recvmmsg(0x3, 0x68cb80, 0x64, 0, 0) = 1
       "\M-Q?\^A\0\0\^A\0\0\0\0\0\0\abobdole\^Cfdf\^Cnet\0\0\^A\0\^A"
  2538      1 nsd      sendmmsg(0x3, 0x68cb80, 0x1, 0) Err#35 EAGAIN
  2538      1 nsd      issetugid()                 = 1
  2538      1 nsd      open("/usr/share/nls/nls.alias.db", 0x400000, 0) Err#2 
ENOENT
  2538      1 nsd      open("/usr/share/nls/nls.alias", 0x400000, 0) = 8
  2538      1 nsd      __fstat50(0x8, 0x7f7fffffcc70) = 0
  2538      1 nsd      mmap(0, 0x5f0, 0x1, 0x2, 0x8, 0, 0) = 0x7f7ff7f65000
  2538      1 nsd      close(0x8)                  = 0
  2538      1 nsd      munmap(0x7f7ff7f65000, 0x5f0) = 0
  2538      1 nsd      open("/usr/share/nls/C/libc.cat", 0, 0x3a) = 8
  2538      1 nsd      __fstat50(0x8, 0x7f7fffffccf0) = 0
  2538      1 nsd      mmap(0, 0x10be, 0x1, 0x1, 0x8, 0, 0) = 0x7f7ff7f64000
  2538      1 nsd      close(0x8)                  = 0
  2538      1 nsd      munmap(0x7f7ff7f64000, 0x10be) = 0
  2538      1 nsd      __gettimeofday50(0x7f7fffffc190, 0) = 0
  2538      1 nsd      getpid()                    = 2538, 13362
  2538      1 nsd      fcntl(0xa, 0x3, 0)          = 2
  2538      1 nsd      sendto(0xa, 0x7f7fffffc1b0, 0x75, 0, 0, 0) = 117
       "<27>1 2013-12-03T03:42:32.309243+00:00 bobdole.fdf.net nsd 2538 - - s"
  2538      1 nsd      getpid()                    = 2538, 13362
  2538      1 nsd      __gettimeofday50(0x7f7fffffd320, 0) = 0
  2538      1 nsd      write(0x2, 0x7f7fffffca10, 0x50) = 80
       "[1386042152] nsd[2538]: error: sendmmsg failed: Resource temporarily "
  2538      1 nsd      write(0x2, 0x652bc7, 0x1)   = 1
       "\n"
  2538      1 nsd      __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0
  2538      1 nsd      __gettimeofday50(0x7f7fffffd6d0, 0) = 0
  2538      1 nsd      __kevent50(0x7, 0x7f7ff7315000, 0, 0x7f7ff7316000, 0x40, 
0) = 1
  2538      1 nsd      __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0
  2538      1 nsd      __gettimeofday50(0x7f7fffffd6d0, 0) = 0
  2538      1 nsd      recvmmsg(0x3, 0x68cb80, 0x64, 0, 0) Err#35 EAGAIN
  2538      1 nsd      __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0
  2538      1 nsd      __gettimeofday50(0x7f7fffffd6d0, 0) = 0
  2538      1 nsd      __kevent50(0x7, 0x7f7ff7315000, 0, 0x7f7ff7316000, 0x40, 
0) = 1
  2538      1 nsd      __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0
  2538      1 nsd      __gettimeofday50(0x7f7fffffd6d0, 0) = 0
  2538      1 nsd      recvmmsg(0x3, 0x68cb80, 0x64, 0, 0) Err#35 EAGAIN

So the initial recvmmsg works, however every subsequent call to either 
recvmmsg/sendmmsg always return EAGAIN, causing the process to loop.
>How-To-Repeat:
Install net/nsd (from pkgsrc HEAD) on a -current kernel since the original 
2012/06/22 import of recvmmsg/sendmmsg.
>Fix:



Home | Main Index | Thread Index | Old Index