RE: LOR: sigacts vs Giant

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 13 Aug 2003 14:34:15 -0400 (EDT)
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) _at_ kern/subr_trap.c:260
>  2nd 0xe000000000b75250 Giant (Giant) _at_ 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_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
Received on Wed Aug 13 2003 - 09:33:56 UTC

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