Re: [PATCH bpf v2 09/15] selftests/bpf: Fix double thread join in uprobe_multi_testg
From: Jiri Olsa
Date: Sun Feb 22 2026 - 17:18:39 EST
On Wed, Feb 18, 2026 at 09:54:41AM -0800, Ihor Solodrai wrote:
> On 2/17/26 4:30 PM, 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 with a memset(0) call at the end of release_child().
> >
> > Acked-by: Mykyta Yatsenko <yatsenko@xxxxxxxx>
> > Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > Signed-off-by: Ihor Solodrai <ihor.solodrai@xxxxxxxxx>
> > ---
> > tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > 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..be6ff1d4a75b 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
> > @@ -68,6 +68,7 @@ static void release_child(struct child *child)
> > close(child->c2p[1]);
> > if (child->pid > 0)
> > waitpid(child->pid, &child_status, 0);
> > + memset(child, 0, sizeof(*child));
>
> The CI is failing because of this change.
it's on that child->pid,child->tid check in uprobe_multi_test_run?
>
> Apparently, there are asserts on child object after it's released in
> kick_child(), so we can't just memset it (without changing the test
> logic). The previous version of the fix [1], resetting only
> child->thread, is more appropriate I think.
>
> I missed this because uprobe_multi is in DENYLIST.asan
>
> I'll wait a bit in case there is more feedback and send a v3.
I think we should somehow separate the thread logic from the child to
make the test more clear.. I'll take a look
for now zero-ing the thread, so there's no double join makes sense to me
thanks,
jirka
>
> [1] https://lore.kernel.org/bpf/20260212011356.3266753-10-ihor.solodrai@xxxxxxxxx/
>
> > }
> >
> > static void kick_child(struct child *child)
>
>