From owner-cvs-all@FreeBSD.ORG Fri Sep 29 18:26:52 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D83AB16A412; Fri, 29 Sep 2006 18:26:52 +0000 (UTC) (envelope-from mb@imp.ch) Received: from pop.imp.ch (mx2.imp.ch [157.161.9.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1F9943D77; Fri, 29 Sep 2006 18:26:44 +0000 (GMT) (envelope-from mb@imp.ch) Received: from godot.imp.ch (godot.imp.ch [157.161.4.8]) by pop.imp.ch (8.13.8/8.13.8/Submit_imp) with ESMTP id k8TIQeav028670; Fri, 29 Sep 2006 20:26:42 +0200 (CEST) (envelope-from mb@imp.ch) Date: Fri, 29 Sep 2006 20:26:40 +0200 (CEST) From: Martin Blapp To: Martin Blapp In-Reply-To: <200609290952.k8T9qvcU053566@repoman.freebsd.org> Message-ID: <20060929202338.W91466@godot.imp.ch> References: <200609290952.k8T9qvcU053566@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.57 on 157.161.9.65 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern tty_pty.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2006 18:26:53 -0000 Hi all, > Free tty struct after last close. This should fix the pty-leak by numbers. > Remove workarounds for tty_refcount beeing 0, this will be fixed differently > later. > > Back out rev 1.145 since we initialize the tty struct from scratch and bad > things can't happen anymore. > Sigh. Peter Holmes stress tests did show that we still have problems. With the beckout of rev. 1.145 we get again the same panics as the pty_pts code does. This is deep somewhere in the devfs code. It does happen with/without freeing struct tty. Memory modified after free 0xc45b7d00(252) val=deadc0dd @ 0xc45b7d70 panic: Most recently used by DEVFS1 cpuid = 3 KDB: enter: panic [thread pid 1025 tid 100131 ] Stopped at kdb_enter+0x2b: nop db> where Tracing pid 1025 tid 100131 td 0xc44c71b0 kdb_enter(c091cc03) at kdb_enter+0x2b panic(c09385bd,c0914676,c093858e,c45b7d00,fc,...) at panic+0x14b mtrash_ctor(c45b7d00,100,0,502) at mtrash_ctor+0x4d uma_zalloc_arg(c186d1e0,0,502) at uma_zalloc_arg+0x10f malloc(d8,c09bd120,502,e679c8f0,c0670c4c,...) at malloc+0xb2 devfs_alloc(c45a3400,c45a3400,c4599c00,e679c918,c0670d5d,...) at devfs_alloc+0x17 make_dev_credv(c09cce00,d,c4341480,0,0,...) at make_dev_credv+0x34 make_dev_cred(c09cce00,d,c4341480,0,0,...) at make_dev_cred+0x21 pty_create_slave(c4341480,c45a3400,d) at pty_create_slave+0x53 ptcopen(c4599c00,3,2000,c44c71b0,c0a0bd28,0,c0918871,f1) at ptcopen+0x61 giant_open(c4599c00,3,2000,c44c71b0) at giant_open+0x30 devfs_open(e679ca14) at devfs_open+0x1e7 VOP_OPEN_APV(c09bd620,e679ca14) at VOP_OPEN_APV+0x9b vn_open_cred(e679cb7c,e679cc7c,0,c4341480,3,...) at vn_open_cred+0x41e vn_open(e679cb7c,e679cc7c,0,3) at vn_open+0x1e kern_open(c44c71b0,bfbfe410,0,3,0,...) at kern_open+0xb9 open(c44c71b0,e679cd04) at open+0x18 syscall(3b,3b,bfbf003b,bfbfe41b,ffffffff,...) at syscall+0x256 Xint0x80_syscall() at Xint0x80_syscall+0x1f