| Summary: | syscall-wrapper waitid warns about infop=null | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Matthias Schwarzott <zzam> |
| Component: | memcheck | Assignee: | Paul Floyd <pjfloyd> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mark, pjfloyd |
| Priority: | NOR | ||
| Version First Reported In: | 3.25 GIT | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
syscall-wrapper waitid handles infop=null correctly
syscall-wrapper waitid handles infop=null correctly (V2) |
||
|
Description
Matthias Schwarzott
2025-08-26 19:28:10 UTC
I was sceptical this was correct. But it is really a (non-portable) linux kernel extension for waitid:
According to POSIX.1-2008, an application calling waitid() must ensure
that infop points to a siginfo_t structure (i.e., that it is a non-null
pointer). On Linux, if infop is NULL, waitid() succeeds, and returns
the process ID of the waited-for child. Applications should avoid rely‐
ing on this inconsistent, nonstandard, and unnecessary feature.
Thanks for the testcase.
Created attachment 184537 [details] syscall-wrapper waitid handles infop=null correctly (V2) Updated the patch to be applied after https://bugs.kde.org/show_bug.cgi?id=508777 and https://bugs.kde.org/show_bug.cgi?id=508869 commit 405fb0daaf329068a5219ef4c0e645cea872cf75 (HEAD -> master, origin/master, origin/HEAD) Author: Matthias Schwarzott <zzam@gentoo.org> Date: Sat Aug 23 13:37:46 2025 +0200 Bug 508778 - syscall-wrapper waitid warns about infop=null This is used by e.g. Qt: https://github.com/qt/qtbase/blob/e17798560b107b7abd5f2cf472d942e8ac4213ff/src/3rdparty/forkfd/forkfd_linux.c#L128 |