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

Matthew Dillon dillon at
Tue Oct 10 08:42:18 PDT 2006

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 
  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.
  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
  Reviewed-by: "Simon 'corecode' Schubert" <corecode at 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

More information about the Commits mailing list