*BSD News Article 8858


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.hawaii.edu!ames!haven.umd.edu!uunet!news.univie.ac.at!news.tu-graz.ac.at!fstgds01!chmr
From: chmr@fstgds01.tu-graz.ac.at (Christoph Robitschko)
Subject: Re: More on pccons/XFree86 problems (keyboard hangs)
Message-ID: <1992Dec14.115444.12691@news.tu-graz.ac.at>
Keywords: 386BSD X11 XFree86 console pccons
Sender: news@news.tu-graz.ac.at (USENET News System)
Nntp-Posting-Host: fstgds01
Organization: Technical University of Graz, Austria
References: <1992Dec13.172900.451@ponds.uucp>
Date: Mon, 14 Dec 92 11:54:44 GMT
Lines: 35

In article <1992Dec13.172900.451@ponds.uucp> rivers@ponds.uucp (Thomas David Rivers) writes:
>  Try it out yourself, inside of an X window, do a :
>
>     kill -1 `cat /var/run/syslog.pid`
>
>  and your keyboard will lock up.
>
>
>I will probably try and examine the stock pccons.c to determine where
>the problem can be corrected... but if someone has an idea/fix, feel
>free to beat me to it...
>
The problem is that the pccons driver is used in two ways: first in 
the standard way through pcopen() etc., and second as a console device
through cnopen(). 
The cn???() calls simply call the corresponding pc???() routines, which 
is OK for open(), read() and write(), but not for close(), because
the close routine is only to be called when the LAST reference to 
the device was closed. But when the last reference to the console device
is closed (as happens when you kill or SIGHUP the syslogd), cnclose()
calls pcclose(), no matter if there are any references to the pccons
device (such as the keyboard input for your shell or X server).
pcclose() then thinks there is no more reference to it and disables
keyboard input.

One possible solution would be to modify pcclose() to only do the real
close operation if there are really no more files open on it (A sort of
reference count or reference bits for each device type is needed).

I don't know if any of the replacement pccons (or codrv) drivers fix this.


							Christoph
-- 
..signature: Connection timed out