Re: -current panic

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 30 Mar 2004 18:24:20 -0500
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
_at__at_ -1914,10 +1914,9 _at__at_
 	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) {
 
_at__at_ -1957,20 +1956,18 _at__at_
 	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_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Wed Mar 31 2004 - 10:55:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:49 UTC