kern/101763: [panic] sodealloc(): so_count 1

Gleb Kozyrev gkozyrev at ukr.net
Fri Aug 11 21:05:35 UTC 2006


Robert Watson wrote to "Gleb Kozyrev" <gkozyrev at gmail.com> on Fri, 11 Aug 2006 10:29:01 +0100 (BST):

> GK>> Here you are: kern/101763
>> 
>> I'm sorry for misleading you.
>> You see, for some reasons I forgot that there's a little jail on
>> that machine. ;)
>> It is ipfw in jail that triggers the panic invoked from
>> /etc/periodic/security/500.ipfwdenied

RW> Try this minor tweak:

RW> Index: uipc_socket.c
RW> ===================================================================
RW> RCS file: /data/fbsd-cvs/ncvs/src/sys/kern/uipc_socket.c,v
RW> retrieving revision 1.277
RW> diff -u -r1.277 uipc_socket.c
RW> --- uipc_socket.c 2 Aug 2006 00:45:27 -0000 1.277
RW> +++ uipc_socket.c 11 Aug 2006 09:27:52 -0000
RW> @@ -367,6 +367,9 @@
RW>    so->so_count = 1;
RW>    error = (*prp->pr_usrreqs->pru_attach)(so, proto, td);
RW>    if (error) {
RW> +  KASSERT(so->so_count == 1, ("socreate: so_count %d",
RW> +      so->so_count));
RW> +  so->so_count = 0;
RW>     sodealloc(so);
RW>     return (error);
RW>    }

RW> Looks like I made a logic error in my change to move to sodealloc() here:
RW> the refcount is never reduced back from when it is initially set to 1,
RW> and sodealloc() has a "no references" assertion (possibly that I added).

It works fine now, thank you.

-- 
With best regards, Gleb Kozyrev. 




More information about the freebsd-current mailing list