[PATCH] Fix WAIT_FOR_DEBUGGER for container tests.
Stefan Liebler
stli@linux.ibm.com
Mon Oct 16 07:53:14 GMT 2023
On 13.10.23 15:20, Adhemerval Zanella Netto wrote:
>
>
> On 04/10/23 05:03, Stefan Liebler wrote:
>> On 03.10.23 20:12, Adhemerval Zanella Netto wrote:
>>>
>>>
>>> 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.
>>>
>> For me, it failed with "WAIT_FOR_DEBUGGER=1 make test
>> t=nss/tst-nss-gai-hv2-canonname". After gdb attached to the process, gdb
>> has not found a suitable binary and thus can't set wait_for_debugger.
>
> Ok, I see the failure now.
>
>>
>> The same seems also to happen for "./debugglibc.sh -c --
>> ./nss/tst-nss-gai-hv2-canonname".
>>
>> Can you please check if your ./nss/tst-nss-gai-hv2-canonname.gdb
>> contains "set sysroot"?
>> For me it does not work on s390x / x86_64. In both cases, I'm using
>> Fedora 38.
> Yes, with the patch the sysroot is now set correctly.
>
> LGTM, thanks.
>
> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Thanks for the review. I've just committed the patch.
More information about the Libc-alpha
mailing list