DragonFly BSD
DragonFly commits List (threaded) for 2006-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

cvs commit: src/sys/kern kern_fork.c kern_proc.c kern_sig.c src/sys/sys proc.h signalvar.h unistd.h


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Oct 2006 08:40:47 -0700 (PDT)

dillon      2006/10/10 08:40:47 PDT

DragonFly src repository

  Modified files:
    sys/kern             kern_fork.c kern_proc.c kern_sig.c 
    sys/sys              proc.h signalvar.h unistd.h 
  Log:
  Fix a long-standing bug inherited from FreeBSD.  It is possible for a
  signal sent to a process group to race a fork().  If the signal is received
  by the process doing the fork() before it finishes hooking up the new child
  to the process group the new child will not receive the signal.  The result
  is that ^C does not always kill all the processes in the process group.
  
  The problem occurs on UP systems if fork1() in the kernel blocks prior to
  finishing the process setup.  Such blocking can occur in MALLOC.  The problem
  can also occur if an interrupt occurs just as the process issues the fork()
  system call, or on SMP systems where the signal is sent from a different cpu.
  
  The solution is to use a lockmgr() lock to interlock the pgrp structure when
  a signal is being sent to a process group and to have fork() check for
  signal pre-conditions and return ERESTART if such conditions exist to force
  processing of the pending signals.
  
  NOTE!  BMAKE, MAKE, GNUMAKE ALSO HAVE UNRELATED SIGNALING BUGS.  These
  programs improperly install a SIG_IGN for a few microseconds in order to
  test the current signal function for SIGINT and various other signals.
  If a ^C is sent while *MAKE is in this window, the *MAKE will ignore the
  signal.
  
  Reviewed-by: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
  
  Revision  Changes    Path
  1.58      +33 -7     src/sys/kern/kern_fork.c
  1.29      +1 -0      src/sys/kern/kern_proc.c
  1.55      +16 -3     src/sys/kern/kern_sig.c
  1.87      +2 -0      src/sys/sys/proc.h
  1.15      +19 -1     src/sys/sys/signalvar.h
  1.6       +3 -2      src/sys/sys/unistd.h


http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_fork.c.diff?r1=1.57&r2=1.58&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_proc.c.diff?r1=1.28&r2=1.29&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_sig.c.diff?r1=1.54&r2=1.55&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/sys/proc.h.diff?r1=1.86&r2=1.87&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/sys/signalvar.h.diff?r1=1.14&r2=1.15&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/sys/unistd.h.diff?r1=1.5&r2=1.6&f=u



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