Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756070Ab3CQHxN (ORCPT ); Sun, 17 Mar 2013 03:53:13 -0400 Received: from order.stressinduktion.org ([87.106.68.36]:39810 "EHLO order.stressinduktion.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755782Ab3CQHxL (ORCPT ); Sun, 17 Mar 2013 03:53:11 -0400 Date: Sun, 17 Mar 2013 08:53:10 +0100 From: Hannes Frederic Sowa To: Eric Dumazet , dormando , Cong Wang , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: BUG: IPv4: Attempt to release TCP socket in state 1 Message-ID: <20130317075310.GG24041@order.stressinduktion.org> Mail-Followup-To: Eric Dumazet , dormando , Cong Wang , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <1362494795.15793.113.camel@edumazet-glaptop> <1362663990.15793.208.camel@edumazet-glaptop> <1363301786.29475.40.camel@edumazet-glaptop> <1363303174.29475.46.camel@edumazet-glaptop> <1363455366.29475.66.camel@edumazet-glaptop> <20130317063948.GF24041@order.stressinduktion.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130317063948.GF24041@order.stressinduktion.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 33 On Sun, Mar 17, 2013 at 07:39:48AM +0100, Hannes Frederic Sowa wrote: > On Sat, Mar 16, 2013 at 10:36:06AM -0700, Eric Dumazet wrote: > > On Fri, 2013-03-15 at 00:19 +0100, Eric Dumazet wrote: > > > > > Thanks thats really useful, we might miss to increment socket refcount > > > in a timer setup. > > > > > > > Hmm, please add following debugging patch as well > > > > diff --git a/include/net/sock.h b/include/net/sock.h > > index 14f6e9d..fe7c8a6 100644 > > --- a/include/net/sock.h > > +++ b/include/net/sock.h > > @@ -530,7 +530,9 @@ static inline void sock_hold(struct sock *sk) > > */ > > static inline void __sock_put(struct sock *sk) > > { > > - atomic_dec(&sk->sk_refcnt); > > + int newref = atomic_dec_return(&sk->sk_refcnt); > > + > > + BUG_ON(newref <= 0); > > } > > Couldn't it also be a free from sock_wfree where the wmem accounting went > wrong? It does not care about reference counts there. nvm, it had to be in the stacktrace then. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/