Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1439835pxj; Fri, 4 Jun 2021 14:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMGfim5gZB2MvAeumEL8kUUDo+rRNxZVT+WxKtBYgxJ4kEYFjiscP/oPxupfSn/MuBWcvs X-Received: by 2002:a05:6402:1c11:: with SMTP id ck17mr7105489edb.102.1622842850599; Fri, 04 Jun 2021 14:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622842850; cv=none; d=google.com; s=arc-20160816; b=azIZRbCEGa5YKDkUkhDtHdUlJr4joSadRNtoQSSQx0Y+R3CwZ38JI2AbyZwfIjqdTd cbFYCc5gNBrJ8VlAxoqwsixntlIlK47hcUb2iLhAKqIqAuUtzIF9J/n1L7VO5wlGiYb5 p8ltqHeOjyicqi6pN+nPeM2wxF+c2XGkiTh4vK6NX6Y0kXnxopVOH5l+I0e+4VipoDmw /38k6VcbcHXDyA4Ib0tozwaM8Xaw+KbvRrOU/l8SuNZa9XzMBF/0RN0XSXa+g3ql+RK6 ThjYe1nGShkjaQs50VKQro3t1nif62H7CDcztPhklB26p5zQjjzjTj14yTfzIIq0VJUM YUtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PeKeB3TvL1tWV4Q5VttMOtqa8ltLzI98QJmLmRexFto=; b=vTCFTXVRQ93Zayaku88Zl99ua0cGEB6sEIXyoo2z9f7tsGX7RH8mhtGm+gjKclY3Mu RL3WtHbqu/tc3wx8kpa71nMvWWUIljhZWBLP1pK5SIljf/z/csu+50NHlbSh7d+cymo4 ETfAEM9zdNaXjOx5PqMitretAN466HRKqdYSJqV4hIPn+WjfJvfkVdzsPsYLIPz4HQHc A7xvh4P/H+ah5WBaJ9UTb8zPwmKl0YvMX0RLlsOn/637BcEBpGsXJWOOR2+zqFEeSIKL 76KstF6j04iHqhlcDeFbqZfPEvCf7PbO4uSBmNP7mAzuS3sFcUXJPrAtCbvGHrlbtHIh ncMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tc3jtofa; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si2972747edl.469.2021.06.04.14.40.27; Fri, 04 Jun 2021 14:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tc3jtofa; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbhFDVlH (ORCPT + 99 others); Fri, 4 Jun 2021 17:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbhFDVlG (ORCPT ); Fri, 4 Jun 2021 17:41:06 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E27D4C061766 for ; Fri, 4 Jun 2021 14:39:19 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id i6so1002223ybm.1 for ; Fri, 04 Jun 2021 14:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PeKeB3TvL1tWV4Q5VttMOtqa8ltLzI98QJmLmRexFto=; b=tc3jtofa1MFWrBhQPW0iEp8+eQpG8SUV/4MPWwuQGDVhqshLEshOzbwUG74c6irKBH ISIgXJx6YjoXK3Ee2TnoCFpFjqziHmdiwHsHsxfDH6e09NHNnMbE0rrFPgu7d0ooor/6 21SAB+ceVVkGx7PtIQtG17p3XgIpQxWgvdlCN2Nh6Z4FL13dsT6OyWSp7fwymzM/vmIt 69cfTpDb5Rc1M1SO3AePwlsthxsu4yoEpDYlps6vvofix8uVLx+F2DP0WKtGPwoqHOXg OsYiZOhe0Ldxl4HaWxof882yLN1fW/SNukl9SddpxVpzftv8C47THB5yVv4YuwkYRYWu X+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PeKeB3TvL1tWV4Q5VttMOtqa8ltLzI98QJmLmRexFto=; b=eDEfqfIGylc5Sj+Y/yVC3CGB+I1j9aIUD0T10kQJJem6nw2Q5dDb33M0gf1leilFaL FZ+fse9uw/Toe+505oXXn6ZbC9IEW9djzwGGtCxORxoVg9RLf4DuL/buxIW/rkKC4y8R HUiotK3FhHOLQm8nsgAkNOFXuRkiNiMyo+og6aFqYfmTkH3yc4Cp6DsZWNPdd9vR9Vwe u0/HY3G/agyDdOdgWMZAU3vHWxyaj+prQVcZYB8F0cUUh9iLegmmeNYjf26KIVx6lofg ulNXAb/eYV1nS2gKoELWnv7/ttjNbjRjTwlnXpOba+QdNpE8oNA3HROvSPPReabwGALI KfsA== X-Gm-Message-State: AOAM531dEb0Qb51x2TGDW6/dEObGIQsUVM7V5CBMG9anx++ySQ8ZbxoQ uIblidz5qzTmM6FBgGN8bxRI7nBmi/T3/wbmNlZcwl6kLiE= X-Received: by 2002:a25:4048:: with SMTP id n69mr8269929yba.91.1622842758213; Fri, 04 Jun 2021 14:39:18 -0700 (PDT) MIME-Version: 1.0 References: <749228e2-4d49-83ef-06f0-2db0532beb93@systech.com> In-Reply-To: <749228e2-4d49-83ef-06f0-2db0532beb93@systech.com> From: Luiz Augusto von Dentz Date: Fri, 4 Jun 2021 14:39:07 -0700 Message-ID: Subject: Re: Bluez Socket File Descriptor Leak To: jay@systech.com Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Jay, On Fri, Jun 4, 2021 at 12:14 PM Jay Foster wrote: > > I am experiencing an odd problem with PAN networking. I have PAN > networking setup in NAP role. Another machine makes a BNEP connection > and performs network activity, then disconnects the BNEP connection. > This repeats periodically. This works just fine, except after a while, > the BNEP connection fails with the following in the log. > > May 4 13:08:02 (none) daemon.debug bluetoothd[1373]: > profiles/network/server.c:confirm_event() BNEP: incoming connect from > B8:27:EB:E5:35:9B > May 4 13:08:03 (none) daemon.err bluetoothd[1373]: Can't add bnep0 to > the bridge br1: Too many open files(24) > > ls /proc/`pidof bluetoothd`/fd shows about 1000 open file descriptors > (sockets mostly). This looks like some kind of resource (file > descriptor) leak. > > Has anyone experienced this before? I don't know if it is in the > bluetoothd application or one if the libraries (glib2, dbus) it links > with. Happens with bluez 5.19 and 5.52. That looks like the fd are not released (via close) after they are attached to the bridge, you could in theory increase the number of fd a process can have in the meantime but we will need to fix this problem at some point so please have a issue created in github: https://github.com/bluez/bluez/ -- Luiz Augusto von Dentz