Re: [PATCH] selftests/proc: avoid exit() from SIGALRM handler
From: Alexey Dobriyan
Date: Tue Sep 08 2026 - 15:35:20 EST
On Fri, Sep 04, 2026 at 01:37:52PM +0100, Paul Dolan wrote:
> proc-tid0 uses SIGALRM to stop the test after one second, but the
> signal handler calls exit(), which is not async-signal-safe.
>
> Set a sig_atomic_t flag from the handler instead and let the main loop
> terminate normally. This also preserves the existing atexit cleanup
> that kills the worker child.
>
> Fixes: 0658a0961b0a ("procfs: do not list TID 0 in /proc/<pid>/task")
> Signed-off-by: Paul Dolan <paul.dolan.dev@xxxxxxxxx>
Yeah, yeah.
Reviewed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
> static void sigalrm(int _)
> {
> - exit(0);
> + alarmed = 1;
> }