Bug 29485 - Make hangs when the test misc/tst-pidfile returns FAIL_UNSUPPORTED
Summary: Make hangs when the test misc/tst-pidfile returns FAIL_UNSUPPORTED
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.36
: P2 normal
Target Milestone: 2.37
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-14 00:46 UTC by Frederik Schwan
Modified: 2022-08-16 05:31 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Patch fixing the bug (812 bytes, patch)
2022-08-14 00:46 UTC, Frederik Schwan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Schwan 2022-08-14 00:46:14 UTC
Created attachment 14275 [details]
Patch fixing the bug

Arch Linux builds glibc in a systemd-nspawn. To avoid issues with the testsuite, we disable some tests that require syscalls not allowed by nspawn.
Commit (bisected) 325ba824b0611e14e96b38dbc486acf255f9e568 introduced a hang of make after printing the test summary at the end.

The root cause in sysdeps/unix/sysv/linux/tst-pidfd.c is the early return in line 150 which is causing the process, spawned in line 46, to hang on line 84 waiting for the signal in line 170.

Patch attached.
Comment 1 Sam James 2022-08-14 21:39:53 UTC
CCing mjw.
Comment 2 Florian Weimer 2022-08-15 05:39:20 UTC
Patch posted:

[PATCH] Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
<https://sourceware.org/pipermail/libc-alpha/2022-August/141414.html>
Comment 3 Mark Wielaard 2022-08-15 09:23:39 UTC
Thanks for noticing this. I missed this in the buildbot testing since the whole make check is wrapped in a timeout. The test itself succeeds (gets marked UNSUPPORTED). But the subprocess still runs causing make check to hang. In the buildbot runs this then gets cleaned up after make check stops producing output for a couple of minutes. The proposed fix looks OK (but I haven't tested it yet).
Comment 4 Florian Weimer 2022-08-15 14:45:05 UTC
Fixed for glibc 2.37 via:

commit f82e05ebb295cadd35f7372f652c72264da810ad
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Aug 15 16:43:59 2022 +0200

    Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Comment 5 Mark Wielaard 2022-08-15 21:13:50 UTC
Very nice, this reduced the make check time on the glibc-fedora-x86_64 buildbot from 32 to 13 minutes (which was that 20 min timeout) without changing the test results.

https://builder.sourceware.org/buildbot/#/builders/glibc-fedora-x86_64

There are only 3 failures left, for which there are patches posted/pending:

FAIL: misc/tst-personality
https://patchwork.sourceware.org/project/glibc/patch/20220626205915.33201-5-mark@klomp.org/
FAIL: misc/tst-pkey
https://patchwork.sourceware.org/project/glibc/patch/20220626205915.33201-3-mark@klomp.org/
FAIL: time/tst-clock2
https://patchwork.sourceware.org/project/glibc/patch/20220627104826.4303-1-mark@klomp.org/

I wonder if those are the same tests you see failing and/or disable under systemd-nspawn?
Comment 6 Frederik Schwan 2022-08-15 22:47:14 UTC
We only disable one out of the three tests.
https://github.com/archlinux/svntogit-packages/blob/packages/glibc/trunk/PKGBUILD#L151

I can't find tst-personality and tst-pkey in the last run I did though. They seem to be excluded due to other reasons I guess.

Is there any chance we get f82e05ebb295cadd35f7372f652c72264da810ad cherry-picked to the 2.36 branch?
Comment 7 Florian Weimer 2022-08-16 05:31:13 UTC
(In reply to freswa from comment #6)
> Is there any chance we get f82e05ebb295cadd35f7372f652c72264da810ad
> cherry-picked to the 2.36 branch?

I'm going to backport it now that we have confirmation it works.