public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Vegard Nossum <vegard.nossum@gmail.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [bug] WARNING: at drivers/char/tty_io.c:1266 tty_open+0x1ea/0x388()
Date: Tue, 16 Jun 2009 09:10:57 +0200	[thread overview]
Message-ID: <20090616071057.GA29862@elte.hu> (raw)
In-Reply-To: <20090614115428.1127ed2d@lxorguk.ukuu.org.uk>


* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> On Sun, 14 Jun 2009 10:10:52 +0200
> Ingo Molnar <mingo@elte.hu> wrote:
> 
> > 
> > Ok, this is one for those who like to look at weird crashes/bugs.
> > 
> > Here's a new regression that popped up in this merge window, there's 
> > some sort of slab corruption going on in tty data structures:
> 
> I split the ldisc and tty apart and redid the ldisc locking so its a fair
> bet I know what changeset is to blame, will just need to hunt it down a
> bit. kmemcheck found one leak case on Friday which I've fixed but not yet
> scribbles.
> 
> >  c65c9bc: tty: rewrite the ldisc locking
> 
> Almost certainly that one and will investigate on Monday

I have applied your patch from yesterday (attached further below for 
reference) and the SLAB corruption has not triggered - instead i'm 
now getting this warning, after 96 reboots:

[   20.782199] sshd used greatest stack depth: 5376 bytes left
[   22.260149] ------------[ cut here ]------------
[   22.261027] WARNING: at drivers/char/tty_io.c:1266 tty_open+0x1ea/0x388()
[   22.262018] Hardware name: System Product Name
[   22.262020] Modules linked in:
[   22.262024] Pid: 2553, comm: modprobe Tainted: G        W  2.6.30-tip #54059
[   22.262026] Call Trace:
[   22.262032]  [<c102d810>] warn_slowpath_common+0x60/0x90
[   22.262037]  [<c102d84d>] warn_slowpath_null+0xd/0x10
[   22.262041]  [<c11a88ae>] tty_open+0x1ea/0x388
[   22.262045]  [<c108e4c2>] chrdev_open+0x11b/0x132
[   22.262049]  [<c108a8a6>] __dentry_open+0x167/0x265
[   22.262052]  [<c108aa3e>] nameidata_to_filp+0x2c/0x43
[   22.262056]  [<c108e3a7>] ? chrdev_open+0x0/0x132
[   22.262060]  [<c1094bbd>] do_filp_open+0x3cd/0x712
[   22.262064]  [<c1083460>] ? check_valid_pointer+0x1f/0x4e
[   22.262068]  [<c109cd26>] ? alloc_fd+0xcb/0xd5
[   22.262071]  [<c109cd26>] ? alloc_fd+0xcb/0xd5
[   22.262075]  [<c108a63d>] do_sys_open+0x4a/0xed
[   22.262078]  [<c1002a5e>] ? sysenter_exit+0xf/0x21
[   22.262081]  [<c108a722>] sys_open+0x1e/0x26
[   22.262085]  [<c1002a2b>] sysenter_do_call+0x12/0x36
[   22.262087] ---[ end trace 81f0afc9843492f2 ]---
[   31.191037] CPA self-test:

Another test-box has produced this warning too. (Same config and 
same hw as i sent the details for earlier in this thread.)

So there's still something fishy going on.

Thanks,

	Ingo

-------------------->
>From 9f7a9ce1955c5f7af7456363a552819a82c19896 Mon Sep 17 00:00:00 2001
From: Alan Cox <alan@linux.intel.com>
Date: Mon, 15 Jun 2009 16:32:12 +0100
Subject: [PATCH] ldisc: Make sure the ldisc isn't active when we close it

Signed-off-by: Alan Cox <alan@linux.intel.com>
LKML-Reference: <20090615153206.4036.26148.stgit@t61.ukuu.org.uk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 drivers/char/tty_ldisc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index 69b912d..0ea4f63 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -792,6 +792,8 @@ void tty_ldisc_hangup(struct tty_struct *tty)
 		/* Avoid racing set_ldisc */
 		mutex_lock(&tty->ldisc_mutex);
 		/* Switch back to N_TTY */
+		tty_ldisc_halt(tty);
+		tty_ldisc_wait_idle(tty);
 		tty_ldisc_reinit(tty);
 		/* At this point we have a closed ldisc and we want to
 		   reopen it. We could defer this to the next open but

  parent reply	other threads:[~2009-06-16  7:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14  8:10 tty_ldisc_try_get(): BUG kmalloc-8: Poison overwritten Ingo Molnar
2009-06-14  8:20 ` Pekka Enberg
2009-06-14  8:30   ` Pekka Enberg
2009-06-14  8:32     ` Pekka Enberg
2009-06-14 23:03       ` Vegard Nossum
2009-06-15  4:25         ` Pekka Enberg
2009-06-14  8:32   ` Ingo Molnar
2009-06-14  8:35     ` Ingo Molnar
2009-06-14 12:32       ` Ingo Molnar
2009-06-14 10:54 ` Alan Cox
2009-06-15  9:10   ` Catalin Marinas
2009-06-16  7:10   ` Ingo Molnar [this message]
2009-06-16  8:44     ` [bug] WARNING: at drivers/char/tty_io.c:1266 tty_open+0x1ea/0x388() Alan Cox
2009-06-16  8:49       ` Ingo Molnar
2009-06-16  9:00         ` Alan Cox
2009-06-16 19:43           ` Ingo Molnar
2009-06-16 10:13     ` Alan Cox
2009-06-16 10:24       ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090616071057.GA29862@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox