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

From: Gleb Kozyrev <gkozyrev_at_ukr.net>
Date: Sat, 12 Aug 2006 00:05:28 +0300
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> _at__at_ -367,6 +367,9 _at__at_
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. 
Received on Fri Aug 11 2006 - 19:05:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:58 UTC