Re: [2.1.113] What is CHECK_TTY_COUNT warning me about?

Bill Hawes (whawes@transmeta.com)
Thu, 06 Aug 1998 21:48:15 -0700


This is a multi-part message in MIME format.
--------------6BF15FCB5CFBBB78BEDFE158
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

We really should mount a concerted effort to find and fix this bug -- it's been
around for a long time, and harmful or not I'd like to at least find what's
causing it.

I've attached a small diagnostic patch to start gathering more info about what's
going on, and would like to ask anyone who occasionally triggers this bug to
apply the patch and report the results back to the kernel list. Hopefully we'll
have this fixed very soon.

Regards,
Bill

--------------6BF15FCB5CFBBB78BEDFE158
Content-Type: text/plain; charset=us-ascii; name="tty_check115-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="tty_check115-patch"

--- linux-2.1.115/drivers/char/tty_io.c.old Thu Aug 6 16:54:08 1998
+++ linux-2.1.115/drivers/char/tty_io.c Thu Aug 6 18:09:00 1998
@@ -184,14 +184,32 @@
if(f->private_data == tty)
count++;
}
+ /*
+ * Check whether a PTY master holds an additional count.
+ */
if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
tty->driver.subtype == PTY_TYPE_SLAVE &&
tty->link && tty->link->count)
count++;
+
if (tty->count != count) {
printk("Warning: dev (%s) tty->count(%d) != #fd's(%d) in %s\n",
kdevname(tty->device), tty->count, count, routine);
- return count;
+
+ printk("task=%s, type=%d, subtype=%d\n",
+ current->comm, tty->driver.type, tty->driver.subtype);
+ /*
+ * Show which files were in use
+ */
+ for(f = inuse_filps; f && f->private_data == tty; f = f->f_next)
+ printk("found f_count=%d, f_dentry=%p, f_op=%p\n",
+ f->f_count, f->f_dentry, f->f_op);
+
+ if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
+ tty->driver.subtype == PTY_TYPE_SLAVE &&
+ tty->link && tty->link->count)
+ printk("pty master holds count\n");
+ return 1;
}
#endif
return 0;

--------------6BF15FCB5CFBBB78BEDFE158--

-
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.altern.org/andrebalsa/doc/lkml-faq.html