> My theory on why it happens (which is just a theory, mind you, but I feel
> better about having a theory, and I have a fairly simple patch to try out
> that I sent out just a moment ago) is as follows:
8< snip >8
> The patch I sent out (and here it is appended again) is completely
> untested, and may not work at all (maybe the first time you close a pty
> pair the kernel will blow up), but I wanted to check the above theory by
> just making the pty case completely synchronous - which it should be
> anyway, because it's just silly to use the routine designed for
> asynchronous events for something synchronous like a pty that doesn't use
> interrupts at all.
That would have been my question (why using the tq for ptys...).
> Anyway, that two-liner is good enough to essentially make the above case
> completely impossible to trigger on any normal machine, but I'll still
> have to do something else to make sure that _real_ asynchronous hangup
> events can't lead to problems. The easiest way to fix things is probably
> to do a simple reference count on the tty structures, but I want to
> validate the basic problem first.
Removed the tty->termios patch and applied this one (that it started
from a fresh kernel tree + this patch): no more warnings, no more
oopses. Looks like the theory's good :-)
Ptys are fixed for me, but I'll do more testing to be sure.
Linus, if you need a testbed to test asynchronous hangups on ptys
(reverting to the old tty_hangup() rather than the synchronous
tty_vhangup() temporarily), I can crash my box a few more times :-)
Phil.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/