Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 2004 18:24:20 -0500
From:      John Baldwin <jhb@FreeBSD.org>
To:        alpha@FreeBSD.org
Cc:        freebsd-current@freebsd.org
Subject:   Re: -current panic
Message-ID:  <200403301824.20780.jhb@FreeBSD.org>
In-Reply-To: <20040329212151.GA10421@electra.cse.Buffalo.EDU>
References:  <20040329212151.GA10421@electra.cse.Buffalo.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 29 March 2004 04:21 pm, Ken Smith wrote:
> Is this one a known issue on alpha or is it something new?  While
> someone was using gdb on beast (alpha cluster ref machine) to trace
> a program beast crashes with this:
>
> panic: mutex process lock not owned at ../../../kern/kern_mutex.c:277
> at line 719 in file ../../../kern/kern_mutex.c
> cpuid = 1;
> Stack backtrace:
> db_print_backtrace() at db_print_backtrace+0x18
> backtrace() at backtrace+0x2c
> __panic() at __panic+0x210
> _mtx_assert() at _mtx_assert+0xec
> _mtx_unlock_flags() at _mtx_unlock_flags+0xa4
> ptrace_single_step() at ptrace_single_step+0x6c
> kern_ptrace() at kern_ptrace+0x3c4
> ptrace() at ptrace+0xe8
> syscall() at syscall+0x37c
> XentSys() at XentSys+0x64
> --- syscall (26) ---
> --- user mode ---
> boot() called on cpu#1
>
> It seems to be reproducible...

This is what I tried to get tested earlier. :)  Try this patch below:

Index: machdep.c
===================================================================
RCS file: /usr/cvs/src/sys/alpha/alpha/machdep.c,v
retrieving revision 1.218
diff -u -r1.218 machdep.c
--- machdep.c	1 Mar 2004 19:19:15 -0000	1.218
+++ machdep.c	30 Mar 2004 23:22:34 -0000
@@ -1914,10 +1914,9 @@
 	if (td->td_md.md_flags & (MDTD_STEP1|MDTD_STEP2))
 		panic("ptrace_single_step: step breakpoints not removed");
 
-	PROC_UNLOCK(td->td_proc);
 	error = ptrace_read_int(td, pc, &ins.bits);
 	if (error)
-		goto err;
+		return (error);
 
 	switch (ins.branch_format.opcode) {
 
@@ -1957,20 +1956,18 @@
 	td->td_md.md_sstep[0].addr = addr[0];
 	error = ptrace_set_bpt(td, &td->td_md.md_sstep[0]);
 	if (error)
-		goto err;
+		return (error);
 	if (count == 2) {
 		td->td_md.md_sstep[1].addr = addr[1];
 		error = ptrace_set_bpt(td, &td->td_md.md_sstep[1]);
 		if (error) {
 			ptrace_clear_bpt(td, &td->td_md.md_sstep[0]);
-			goto err;
+			return (error);
 		}
 		td->td_md.md_flags |= MDTD_STEP2;
 	} else
 		td->td_md.md_flags |= MDTD_STEP1;
 
-err:
-	PROC_LOCK(td->td_proc);
 	return (error);
 }
 

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403301824.20780.jhb>