cvs commit: src/sys/kern tty.c

John Baldwin jhb at
Thu Oct 27 09:47:31 PDT 2005

jhb         2005-10-27 16:47:28 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             tty.c 
  Revert most of revision 1.235 and fix the problem a different way.  We
  can't acquire an sx lock in ttyinfo() because ttyinfo() can be called
  from interrupt handlers (such as atkbd_intr()).  Instead, go back to
  locking the process group while we pick a thread to display information for
  and hold that lock until after we drop sched_lock to make sure the
  process doesn't exit out from under us.  sched_lock ensures that the
  specific thread from that process doesn't go away.  To protect against
  the process exiting after we drop the proc lock but before we dereference
  it to lookup the pid and p_comm in the call to ttyprintf(), we now copy
  the pid and p_comm to local variables while holding the proc lock.
  This problem was found by the recently added TD_NO_SLEEPING assertions for
  interrupt handlers.
  Tested by:      emaste
  MFC after:      1 week
  Revision  Changes    Path
  1.254     +12 -7     src/sys/kern/tty.c

More information about the cvs-src mailing list