#1063931 "strace -f" gets an infinite SIGSEGV loop if namespace PID 1 calls abort()

Package:
strace
Source:
strace
Description:
System call tracer
Submitter:
Michael Gold
Date:
2024-02-15 00:27:06 UTC
Severity:
normal
#1063931#5
Date:
2024-02-15 00:25:14 UTC
From:
To:
When the process being strace'd is PID 1 in a PID namespace and calls
abort(), strace shows an infinite SIGSEGV loop.  Here's a test case:
	#include <stdlib.h>
	int main() { abort(); }

With glibc, running "unshare -prf ./a.out" results in the process dying
from a segmentation fault.

By contrast, "strace -f unshare -prf ./a.out" produces an infinite loop
of segfaults.  Perhaps this could be considered a bug in glibc or Linux,
but it seems less than ideal that strace loops forever in a case where
the non-strace'd process would have died.

If strace is capable of detecting that the traced process has no handler
for the signal, it would be nice to detect and avoid the loop.

- Michael