Subject: kern/14368: sysmon_envsys.c deadlock
To: None <gnats-bugs@gnats.netbsd.org>
From: Anthony Mallet <anthony.mallet@useless-ficus.net>
List: netbsd-bugs
Date: 10/27/2001 00:24:07
>Number:         14368
>Category:       kern
>Synopsis:       sysmon_envsys.c deadlock
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 26 15:25:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anthony Mallet
>Release:        -current as of October 20
>Organization:
>Environment:
System: NetBSD ficus 1.5Y NetBSD 1.5Y (FICUS) #13: Fri Oct 26 23:43:01 CEST 2001 toto@ficus:/home/src/netbsd-current/sys/arch/i386/compile/FICUS i386
Architecture: i386
Machine: i386
>Description:
	When /dev/sysmon is opened twice by two different processes, the
second process blocks infinitely, certainly because it cannot acquire the
'sysmon_envsys_lock'. That's ok.
	
	If the first process stops *before* the second one, no more
process can gain access to /dev/sysmon. See 'How-To-Repeat' for more
details.
>How-To-Repeat:
	1   launch `/usr/sbin/envstat -i 1` ( name it "A").
	2   launch another `/usr/sbin/envstat -i 1`  (name it "B").
	2.5 see how "B" is blocked --- ok.
	3   kill -INT the "A" process.
	3.5 see how the "B" process does *not* gain access to sysmon.
            Not ok!
	4   kill -INT the "B" process.
	4.5 see how *no more* process can access to susmon...
>Fix:
	Dunno at this time. I can compile a kernel with LOCK_DEBUG and
symbols if it is needed.
>Release-Note:
>Audit-Trail:
>Unformatted: