Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 2009 13:44:27 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/tools/regression/file/newfileops_on_fork Makefile newfileops_on_fork.c
Message-ID:  <200902111344.n1BDiZSo033487@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

rwatson     2009-02-11 13:44:27 UTC

  FreeBSD src repository

  Added files:
    tools/regression/file/newfileops_on_fork Makefile 
                                             newfileops_on_fork.c 
  Log:
  SVN rev 188483 on 2009-02-11 13:44:27Z by rwatson
  
  Add a regresion test to determine whether or not a file descriptor is
  allocated in a fork(2)-inheritable way at the beginning or end of an
  accept(2) system call.  This test creates a test thread and blocks it
  in accept(2), then forks a child process which tests to see if the
  next available file descriptor is defined or not (EBADF vs EINVAL for
  ftruncate(2)).
  
  This detects a regression introduced during the network stack locking
  work, in which a very narrow race during which fork(2) from one
  thread during accept(2) in a second thread lead to an extra inherited
  file descriptor turned into a very wide race ensuring that a
  descriptor was leaked into the child even though it hadn't been
  returned.
  
  PR:             kern/130348
  
  Revision  Changes    Path
  1.1       +8 -0      src/tools/regression/file/newfileops_on_fork/Makefile (new)
  1.1       +121 -0    src/tools/regression/file/newfileops_on_fork/newfileops_on_fork.c (new)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902111344.n1BDiZSo033487>