From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23EF73382F7 for ; Thu, 12 Feb 2026 14:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770907754; cv=none; b=Ag5Q+t/U41UcZjLFgR75EpYYvIDmpGyYixkdab+SWksHE2NGImfAprHbghwsz7+APdL+N1wTL9DiwHutH6bE8gE4NCsb0kcPrDyBNGvj7rPMgeTD0VrOgHN0s2NdrZ1HEpy8E8fsPmoM4t/YESVWQkAkIIS4vijvWJRjjM2IDeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770907754; c=relaxed/simple; bh=PK5jjgixGKlQ/vKoNy93k+86pzOAo0ehsGjF099RB2k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KIBuEtE78ryklmlRweeh67qHMVWfzJZZfFLe9UWlcRJuot96Xc4asgQcAafREvN5FnoLzgkQOMjJT+U7jvaAdQWyoLc6jQP52OGQFd7jIJJsAs85ir12BMzCvoDV96PfH5RsUEgehrmeor/tfV/soN0bBKehuC18nqWOEi37z0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ok4B7krf; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ok4B7krf" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-480142406b3so64785035e9.1 for ; Thu, 12 Feb 2026 06:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770907751; x=1771512551; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OuJMGPovYQ0mnh7Rx90eYo1i05Ug0FF+c2ji/Q/Pofs=; b=Ok4B7krfQkcrI65ZJ7bGFV5BJBrONeEMy+wWfbGuXlhevWdQo+BkCk6Qck4w0mZX7D YZj3Hr3rTJGaXZUpWso9BGC6f+Fg1XE+dlgUvQsNG+HqRwcaqKiKEl0sg+D46lmcE5Jl NCQQ1rlaKSZOtWsQwEgknbEDaFKzY0GNp4NBPm0mlou+h0Y19FCyBypSl4We5DV2KYhA l9YHqtPQtN5nOD0Knt3snKjDSgNiIfnuuXnBN6yrx4tHJ1KIykfNc82gbFxQueZaiXPW IW8h2RjwW1srwzYWnlFu2VYiM4UkWAR+9273K5cCA9j43U2qZ/taoE1OgZNGwi6czH6I ARvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770907751; x=1771512551; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OuJMGPovYQ0mnh7Rx90eYo1i05Ug0FF+c2ji/Q/Pofs=; b=wwrHXs+BtRiJosUFkKEzuc99aTvB1/7Ukya9A02fuhc6WfZ9/csF3cLMT68xgJhumf O2TtZDfzCP9MBo29kyWUkawDhMbPa4//gL3Bp3lvvyRIM7mlqcHlUTQHNsu0zq4cRqWw bi5j5wte5ZTTRd1COgqd4TZItZ7UAyn2nX9r8uU/B4sXQuMt5dHZ/Drr2Rapsc0LhRcp KgzmUV5g94F2QGwsM4RE7mgFO7EATxD3+qOcQqMP2yX7t1UTQJSn9iT+5FJ2ydhATLme MDn8t4HMzkFX5nG6ncv81SLQCoJ15Rx+EURJADRKB7quabdxxP9spzVvEH7+w5l3MZDs E9ug== X-Forwarded-Encrypted: i=1; AJvYcCVfDwiO6FnjElQ9x/T5m/p/tyqU0Gs7fonl1wWAdp0EqwI98ndY4OvLQUyCbFO6rMwZbt7ClhKL8Ix2T8g=@vger.kernel.org X-Gm-Message-State: AOJu0YxzxKqZwA236HSJFRyZ9JFi7kkdL/viS7EtYw4X3Sz9u8yRnooJ U2V9pnJLPDTx5GvFS7QaERj1sMEdJMjwh7qxUfrw1pcV76ooEvMnuaLp X-Gm-Gg: AZuq6aJyAmQjr7Yu6vO3LBVXLnFPp9+n/zxBVX80/oIpp1B0EikkrHoqk3moSe7HM7z Q3pNrEUkqszyzaJYkibcBSX/LTCcWUA/79OLmn2IG80xMJqT9dj30ZDS+Za2pxlqLD608k6sy5q EA+ljkk/I+Yb1XF+x34sV3yXfiC8LoluIxCH5A7Odbi6q37aYXtyyHtH2K0SSTFLNYHNqc5xgWU 4oexRKP8Yw/FE1OvcRuhzKwSDT+EcQbJdlve/k6bVDGh144CXsvlFbPNC5SuQHH00RvMVFoXVCC pJWVvSNF5FmtcTs0XawvcEeGDt0UTGD8qHuAkAtku07jINp89QBZ6yOmzWLAaylSqVn5OWngNRe 5lO9tt943nRk+j++1LNoK6c7RoE+rxIe/d5XI6R238RdgJ5cOfyd4wKKq/0jdntCMJDOPDPGbt1 HwXyrJCuETrVjofM3YPoVIe+VBCZ0oSS9xjsdgK6elWfFUiklNV6gZi29M/QfCRdo4u5jz5CXPC nzhO6zvTtzIe6Y= X-Received: by 2002:a5d:430e:0:b0:437:8fd6:d849 with SMTP id ffacd0b85a97d-4378fd6d8femr3226987f8f.54.1770907750844; Thu, 12 Feb 2026 06:49:10 -0800 (PST) Received: from ?IPV6:2a01:4b00:bd1f:f500:e85d:a828:282d:d5c7? ([2a01:4b00:bd1f:f500:e85d:a828:282d:d5c7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783e5be13sm12862720f8f.35.2026.02.12.06.49.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Feb 2026 06:49:10 -0800 (PST) Message-ID: <5de2e9e7-2898-49a8-ba1a-253dceddeedd@gmail.com> Date: Thu, 12 Feb 2026 14:49:09 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next v1 09/14] selftests/bpf: Fix double thread join in uprobe_multi_test To: Ihor Solodrai , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Eduard Zingerman Cc: Amery Hung , Mykyta Yatsenko , =?UTF-8?Q?Alexis_Lothor=C3=A9?= , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20260212011356.3266753-1-ihor.solodrai@linux.dev> <20260212011356.3266753-10-ihor.solodrai@linux.dev> Content-Language: en-US From: Mykyta Yatsenko In-Reply-To: <20260212011356.3266753-10-ihor.solodrai@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/12/26 01:13, Ihor Solodrai wrote: > ASAN reported a "joining already joined thread" error. The > release_child() may be called multiple times for the same struct > child. > > Fix by setting child->thread to 0 after pthread_join. > > Signed-off-by: Ihor Solodrai > --- > tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c > index 2ee17ef1dae2..17881e009eee 100644 > --- a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c > +++ b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c > @@ -62,8 +62,10 @@ static void release_child(struct child *child) > return; > close(child->go[1]); > close(child->go[0]); > - if (child->thread) > + if (child->thread) { > pthread_join(child->thread, NULL); > + child->thread = 0; > + } > close(child->c2p[0]); > close(child->c2p[1]); > if (child->pid > 0) As far as I understand the problem is due to `static struct child child` in the test_attach_api(), once we initialize thread field of the child it's not reset before the next test run. Maybe we should also add memset(&child, 0, sizeof(child)); in test_attach_api() before each test to make sure all fields are reset. Acked-by: Mykyta Yatsenko