From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 186B03858D20 for ; Tue, 3 Oct 2023 18:12:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 186B03858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-690d8c05784so945330b3a.2 for ; Tue, 03 Oct 2023 11:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696356734; x=1696961534; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=ciqksq+Fi8y/ayIo+8RMusb4+OcEVUikCM7HPOzKK+I=; b=MINc+VMjl7nd6Wd+U09HCKLgJ6mXZvv4bpSMpDIUQd+O7iiR7asIH8s3quqOFTJwBt ewiNbk13oOPCeWMv7O24sugb7o7usm33Lojc3NhzXo0Z6c56FH1ACiMK8x77pMyLqBhr rnNUVrzfU+tvLHYeofaPIo5enyWJd1a6IsImtUnW2NksOS/TxM8bwm8qiQnzVjPBI/UP +uotvuHpu5eUDWPPHmtH6+NheQgdmd/aBAkNkCCGCK/UVqvfsQXs8qlQGwKuDo6ytgj1 qDeOkF9cgSDgBgdlS1zPX8fXIFfnlHXZc17z75VdOw2PIlNjT5zHqluj4iZtbfV3Vkhn 4h+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696356734; x=1696961534; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ciqksq+Fi8y/ayIo+8RMusb4+OcEVUikCM7HPOzKK+I=; b=Fasl84ahrYvg0YU+sKIyY+C15RjIj9w3dBPKNQEcmjL24RpeIezK5tseXo0N+ZRmua qvBNXloW8DgrA4Ko2Zfh/27acx+/FogjVfDhgZwJkoiP4wjHW67w/P0UsKCZUERcdx0d Rb3uXhxxHXyzOYiT95yIzm0v4tYZyYJUOjfDlEApnfra0lB01QW7cMrJNPgbx/zirHMh C3Jy4sX0VNKesBHUM9ct8UxZ18pDPaohebLFU2obUgBgGdFW6/jO79GxzChLbCiwY71n Tj6EBeQx89zaiZv0KvNqP6puOVU9WTqerSeO3S7+KpzeTGPdeyCiuRaeAtTxI1lhUSFs c03w== X-Gm-Message-State: AOJu0Yw50FE72aIFfZ7PYZd1Qz0T37YS+/QQJeurbqGqZ+SZqx3nbxUG A132CN3QiurqD6uTG0sWC81zMw== X-Google-Smtp-Source: AGHT+IG5dHrQxYb/XGvwNvUTuAGv//8zzvE43iVF3W17C6IArWfWj+OBDJkZlKXmYgr+REUZSsgcAg== X-Received: by 2002:a05:6a00:398b:b0:690:c306:151a with SMTP id fi11-20020a056a00398b00b00690c306151amr418638pfb.0.1696356733986; Tue, 03 Oct 2023 11:12:13 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:feaf:c9f1:61ab:649c:ad56? ([2804:1b3:a7c1:feaf:c9f1:61ab:649c:ad56]) by smtp.gmail.com with ESMTPSA id y22-20020aa78056000000b006889081281bsm1662621pfm.138.2023.10.03.11.12.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 11:12:13 -0700 (PDT) Message-ID: <64b0a8dd-1986-4dcc-b11a-aeb5ca07010e@linaro.org> Date: Tue, 3 Oct 2023 15:12:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix WAIT_FOR_DEBUGGER for container tests. Content-Language: en-US To: Stefan Liebler , libc-alpha@sourceware.org Cc: dj@redhat.com References: <20230928105040.2266853-1-stli@linux.ibm.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20230928105040.2266853-1-stli@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 28/09/23 07:50, Stefan Liebler wrote: > For container tests, gdb needs to set the sysroot to the corresponding > testroot.root directory. The assumption was that PIDs < 3 means that > we are running within a container. > > Starting with commit 2fe64148a81f0d78050c302f34a6853d21f7cae4 > "Allow for unpriviledged nested containers", the default is to use > the PID namespace of the parent. Thus support_test_main.c does not > recognize our container anymore. > > This patch now assumes that we are running inside a container if > test-container.c has set PID_OUTSIDE_CONTAINER and always uses this > PID independent of having a new PID namespace or not. Do you have a scenario where debugglibc is failing to attach to a container test? I am trying to see if something it broken, but it does seems to be working. > --- > support/support_test_main.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/support/support_test_main.c b/support/support_test_main.c > index c20c19e774..f19fce5644 100644 > --- a/support/support_test_main.c > +++ b/support/support_test_main.c > @@ -195,16 +195,14 @@ run_test_function (int argc, char **argv, const struct test_config *config) > char *gdb_script_name; > int inside_container = 0; > > - mypid = getpid(); > - if (mypid < 3) > + const char *outside_pid = getenv("PID_OUTSIDE_CONTAINER"); > + if (outside_pid) > { > - const char *outside_pid = getenv("PID_OUTSIDE_CONTAINER"); > - if (outside_pid) > - { > - mypid = atoi (outside_pid); > - inside_container = 1; > - } > + mypid = atoi (outside_pid); > + inside_container = 1; > } > + else > + mypid = getpid(); > > gdb_script_name = (char *) xmalloc (strlen (argv[0]) + strlen (".gdb") + 1); > sprintf (gdb_script_name, "%s.gdb", argv[0]);