From dan@xkulesh.vol.cz  Sat Sep 14 05:08:35 2002
Return-Path: <dan@xkulesh.vol.cz>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C992A37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 14 Sep 2002 05:08:35 -0700 (PDT)
Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 59BD343E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 14 Sep 2002 05:08:28 -0700 (PDT)
	(envelope-from dan@xkulesh.vol.cz)
Received: from xkulesh.vol.cz (localhost [127.0.0.1])
	by xkulesh.vol.cz (8.12.6/8.12.6) with ESMTP id g8EC8L2K000444
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 14 Sep 2002 14:08:22 +0200 (CEST)
	(envelope-from dan@xkulesh.vol.cz)
Received: (from dan@localhost)
	by xkulesh.vol.cz (8.12.6/8.12.6/Submit) id g8EC8KA6000443;
	Sat, 14 Sep 2002 14:08:20 +0200 (CEST)
Message-Id: <200209141208.g8EC8KA6000443@xkulesh.vol.cz>
Date: Sat, 14 Sep 2002 14:08:20 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: MUTEX_DEBUG broke CURRENT kernel
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42770
>Category:       kern
>Synopsis:       MUTEX_DEBUG broke CURRENT kernel
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 14 05:10:02 PDT 2002
>Closed-Date:    Sat Sep 14 10:49:38 PDT 2002
>Last-Modified:  Sun Sep 15 14:00:12 PDT 2002
>Originator:     Dan Lukes
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
sys/kern/syscalls.master,v 1.121 2002/08/19 20:01:31
sys/kern/kern_prot.c,v 1.164 2002/08/01 17:47:55
sys/kern/kern_proc.c,v 1.147 2002/09/11 08:13:53
sys/kern/kern_mutex.c,v 1.107 2002/09/11 08:13:53
sys/vm/vm_glue.c,v 1.155 2002/09/11 08:13:55
sys/vm/vm_map.c,v 1.266 2002/08/24 17:52:08

>Description:
	MUTEX_DEBUG cause "mutex Giant not owned at vm_map.c:383" (it's
triggered during mounting root). The content of stack:
setsid->enterpgrp->mtx_init->
->mtx_validate->kernacc->vm_map_check_protection->_vm_map_lock_read->_mtx_assert

syscall setsid is marked as MPS_SAFE, so it doesn't obtain Giant lock, but
_vm_map_lock_read required it.

>How-To-Repeat:
	Compile kernel with MUTEX_DEBUG
>Fix:

	workaround - doesn't compile kernel with MUTEX_DEBUG

	I can't supply the fix, but see the note in mtx_validate
(kern_mutex.c) - it seems to be valid not only on alphas.

>Release-Note:
>Audit-Trail:

From: Hiten Pandya <hitmaster2k@yahoo.com>
To: Dan Lukes <dan@obluda.cz>, FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/42770: MUTEX_DEBUG broke CURRENT kernel
Date: Sat, 14 Sep 2002 05:15:48 -0700 (PDT)

 --- Dan Lukes <dan@obluda.cz> wrote:
 > >Number:         42770
 > >Category:       kern
 > >Synopsis:       MUTEX_DEBUG broke CURRENT kernel
 > >Arrival-Date:   Sat Sep 14 05:10:02 PDT 2002
 > >Originator:     Dan Lukes
 > >Release:        FreeBSD 5.0-CURRENT i386
 
 > >Description:
 > MUTEX_DEBUG cause "mutex Giant not owned at vm_map.c:383" (it's triggered 
 > during mounting root). The content of stack:
 [ snip ]
 
 > >How-To-Repeat:
 > Compile kernel with MUTEX_DEBUG
 
 > >Fix:
 > workaround - doesn't compile kernel with MUTEX_DEBUG
 > I can't supply the fix, but see the note in mtx_validate
 > (kern_mutex.c) - it seems to be valid not only on alphas.
 
 Hello Dan.
 
 Problems which happen in the development (-CURRENT) version of FreeBSD
 should not be reported via Problem Reports.  Instead, you should report
 these to the freebsd-current@ mailing list, which, deals with all kinds
 of stuff related to -CURRENT.
 
 For the problem, a fix has been committed by Julian Elischer from
 Jonathan Mini's perforce tree.  The code in vm_map.c required that
 Giant be aqquired.
 
 Please update your sources, and rebuild.
 This PR can be closed.
 
 Thanks.
 
   -- Hiten Pandya
 
 __________________________________________________
 Do you Yahoo!?
 Yahoo! News - Today's headlines
 http://news.yahoo.com
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Sat Sep 14 10:48:59 PDT 2002 
State-Changed-Why:  
Issue should be raised on the current@ mailing list. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42770 

From: Dan Lukes <dan@obluda.cz>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/42770: MUTEX_DEBUG broke CURRENT kernel
Date: Sun, 15 Sep 2002 22:59:31 +0200

 	Unfortunatelly, I can't participate in current@ discussions (I can post 
 via email, but I can read via news only - and I know no news server with 
 copy of current). If bug tracking system is not usable for reporting 
 bug's in current I'm pushed to delay my report's until code reaches RELEASE.
 
 	I hope than someone else will discover and analyse the same problem as 
 I'm - and report it before the code reach the release.
 
 				C'est la vie.
 
 						Dan
 
 
>Unformatted:
