From owner-freebsd-current@freebsd.org Sat Feb 18 21:40:45 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3095ACE42DF for ; Sat, 18 Feb 2017 21:40:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2CC5DCE for ; Sat, 18 Feb 2017 21:40:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1BB891FE025 for ; Sat, 18 Feb 2017 22:40:40 +0100 (CET) To: FreeBSD Current From: Hans Petter Selasky Subject: First thread in proc in not passed to thread_dtor eventhandler upon exit Message-ID: <933e132d-289b-330d-b349-584a25e279d4@selasky.org> Date: Sat, 18 Feb 2017 22:40:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 21:40:45 -0000 Hi, Is the following a bug or feature. I observe that the first thread in a procedure is not passed to thread_dtor as declared by the following eventhandler, when the procedure exits. EVENTHANDLER_DECLARE(thread_dtor, thread_dtor_fn); Is this a bug or feature? I see a couple of clients in the kernel and if the first thread in proc is simply recycled by re-init, we're leaking data for these clients? And I'm planning to add one more for the LinuxKPI. Any insight? --HPS