The process holding the netlock is:

 34831  184306  25445      0  3        0x80  netio         perl

ddb{0}> trace /p 0t184306
sleep_finish(d0bceda0,d09e1903,f5536d2c,d03ce235,db7e4514) at sleep_finish+0xb4
sleep_finish(f5536d3c,1,118,d09e5f10,0) at sleep_finish+0xb4
tsleep(db544cdc,118,d09e5f10,0,0,0,f5536dec,d0570a6e,db53ea40,c9303c25,f5536dbc
,d03aab39) at tsleep+0x14f
sbwait(db544c8c,db544cdc,0,0,f5536ef4) at sbwait+0xa8
soreceive(db544c8c,f5536e94,f5536e6c,0,0) at soreceive+0x43d
recvit(db6ee2a8,0,f5536ed8,cf7da9f0,f5536f7c) at recvit+0x122
sys_recvfrom(db6ee2a8,f5536f5c,f5536f7c,0,f5536fa8) at sys_recvfrom+0x90
syscall() at syscall+0x250

The line in soreceive() is here

/usr/src/sys/kern/uipc_socket.c:736
                sbunlock(&so->so_rcv);
                error = sbwait(so, &so->so_rcv);
                SOCKET_UNLOCK(s);

sbwait() should call rwsleep() not tsleep().

On Thu, Feb 09, 2017 at 12:36:44PM +0100, Martin Pieuchot wrote:
> +int
> +sosleep(struct socket *so, void *ident, int prio, const char *wmesg, int 
> timo)
> +{
> +     if (so->so_proto->pr_protocol != PF_LOCAL)
> +             return rwsleep(ident, &netlock, prio, wmesg, timo);
> +     else
> +             return tsleep(ident, prio, wmesg, timo);
> +}

Here the check must be (so->so_proto->pr_domain->dom_family != PF_LOCAL).

bluhm

Reply via email to