http://defect.opensolaris.org/bz/show_bug.cgi?id=9785


amaguire <alan.maguire at sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alan.maguire at sun.com
             Status|NEW                         |CAUSEKNOWN




--- Comment #1 from amaguire <alan.maguire at sun.com>  2009-06-30 04:41:46 ---
(In reply to comment #0)
> Created an attachment (id=2181)
 --> (http://defect.opensolaris.org/bz/attachment.cgi?id=2181) [details]
> nwam log
> 
> Here I create a wrong enm, set its conditions to itself is active.
> Then when I run "nwamadm list", this command will hang forever.
> 
> bash-3.2# nwamcfg list enm enm1
> ENM:enm1
>         activation-mode conditional-any
>         conditions      "enm enm1 is active"
>         start           "/var/tmp/a start"
>         stop            "/var/tmp/a stop"
> bash-3.2# 
> bash-3.2# 
> bash-3.2# nwamadm list
> .......(endless loop)......
> 
> with another console:
> bash-3.2# mdb -k 
> Loading modules: [ unix genunix specfs dtrace mac cpu.generic
> cpu_ms.AuthenticAMD.15 uppc pcplusmp scsi_vhci zfs mpt sd sockfs ip hook neti
> sctp arp usba stmf fctl nca lofs idm cpc random nfs fcip ptm ufs sppp ]
> > ::pgrep nwamadm
> S    PID   PPID   PGID    SID    UID      FLAGS             ADDR NAME
> R 100966 100849 100966 100478      0 0x4a004000 ffffff017256b398 nwamadm
> > ffffff017256b398::walk thread|::threadlist -v
>             ADDR             PROC              LWP CLS PRI            WCHAN
> ffffff01539dfae0 ffffff017256b398 ffffff0150e28630   1  59                0
>   PC: _resume_from_idle+0xf1    CMD: nwamadm list
>   stack pointer for thread ffffff01539dfae0: ffffff0003eadcb0
>   [ ffffff0003eadcb0 _resume_from_idle+0xf1() ]
>     swtch_to+0xef()
>     shuttle_resume+0x328()
>     door_call+0x2f1()
>     doorfs32+0x141()
>     sys_syscall32+0x1f7()

the reason for the hang is that the condition (object state) is checked while
the object's lock is held in nwamd. To check the state, the object's lock must
again be taken, so we get a hang since nwamadm list tries to get the object's
lock also to read the state, and can't due to the deadlock initiated by the
invalid conditions. Self-referential conditions should be prevented by libnwam
I think. Good catch!

-- 
Configure bugmail: http://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

Reply via email to