[Bug 227285] File descriptor passing does not work reliably on SMP system (cache coherency issue?)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Apr 4 14:24:47 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227285

            Bug ID: 227285
           Summary: File descriptor passing does not work reliably on SMP
                    system (cache coherency issue?)
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: jan.kokemueller at gmail.com
 Attachment #192211 text/plain
         mime type:

Created attachment 192211
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=192211&action=edit
test program

The attached program repeatedly spawns a child process that creates a
socketpair. One socket is passed back to the parent. One byte is written into
the other end. The parent should be able to read this byte, but sometimes 0
(EOF) is returned.

It seems that the parent reuses stale socket/sockbuf memory from prior
iterations.

To simplify the fd passing I've used fd_send/fd_recv from libnv. Those use
SCM_RIGHTS under the hood. The program must be compiled with 'cc -O3 fdpass.c
-lnv'.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list