Re: cvs commit: src/sys/kern tty_pty.c

From: Martin Blapp <mb_at_imp.ch>
Date: Fri, 29 Sep 2006 20:26:40 +0200 (CEST)
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 _at_ 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
Received on Fri Sep 29 2006 - 18:26:52 UTC