[comp.os.minix] ERROR in ST MINIX printer driver.

HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) (06/03/91)

I discovered the following error in the ST MINIX printer driver. It took
quite a while to spot it.

The st printer driver handles valid requests (TTY_WRITE, CANCEL, HARD_INT),
but simply ignores invalid requests in order to reply with EINVAL.

Now, if you do isatty(fd), where fd is connected to /dev/lp, the whole
system hangs: FS sends a message with TTY_IOCTL to PRINTER, and PRINTER
does not respond. This results in FS waiting for PRINTER and PRINTER
waiting for ANY -- a deadlock.

This happens, e.g., if you have ls(1) compiled without defining ONECOLUMN,
and if you do ls -l > /dev/lp

The fix is simply to call 'reply' with EINVAL.

I have plain ST-1.5 adopted to my hardware, so I do not know if it has been
fixed. -- C.v.W.