Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2003 14:34:15 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        current@FreeBSD.org
Subject:   RE: LOR: sigacts vs Giant
Message-ID:  <XFMail.20030813143415.jhb@FreeBSD.org>
In-Reply-To: <20030813180202.GA643@dhcp42.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On 13-Aug-2003 Marcel Moolenaar wrote:
> Gang,
> 
> When the copyout() in sendsig() fails and we call sigexit(), we get
> into the following LOR:
> 
> lock order reversal
>  1st 0xe0000000300ffca8 sigacts (sigacts) @ kern/subr_trap.c:260
>  2nd 0xe000000000b75250 Giant (Giant) @ kern/kern_sig.c:2407
> Stack backtrace:
> witness_lock
> Stopped at      Debugger+0x31:        nop.m 0x0
> db> trace
> Debugger(0xe000000000a41340, 0xe00000000078abe0, 0xea3, 0x1) at Debugger+0x30
> witness_lock(0xe000000000b75250, 0x8, 0xe000000000a3cdc9, 0x967) at witness_lock+0xf60
> _mtx_lock_flags(0xe000000000b75250, 0x0, 0xe000000000a3cdc0, 0x967, 0xe000000000747470, 0x30d,
> 0xe000000000a5c661) at _mtx_lock_flags+0x130
> sigexit(0xe00000002fa4c000, 0xb, 0xe00000002f94afc8, 0xe0000000009ebfe0) at sigexit+0x140
> sendsig(0x400000000005fbf0, 0x2, 0xa00000002308d360, 0x0) at sendsig+0x520
> postsig(0x2, 0xe00000002fa4c000, 0xe0000000300ff000, 0xe00000002f94afc8) at postsig+0x7f0
> ast(0xa00000002308d400) at ast+0x820
>       :
> 
> FYI,

sendsig() on ia64 drops the lock around the copyout, see line 921 in
machdep.c.  It is not reacquired again until the very end of the
function.  You could change the assert at the top of the function to
say that sigacts is not recursed, but sigacts is already a non
recursive lock.  Do you have local diffs to HEAD?

-- 

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?XFMail.20030813143415.jhb>