diff options
| author | Danish Khateeb <danishkhateeb03@gmail.com> | 2026-09-23 15:56:21 -0500 |
|---|---|---|
| committer | Thomas Weißschuh <linux@weissschuh.net> | 2026-09-24 10:48:39 +0200 |
| commit | 368fae47c6cae28a312c5dc86e5bdb8f9369fd26 (patch) | |
| tree | 592ecf7b38315e26618b3035946574631b5f7dd7 /tools/perf/python/stackcollapse.py | |
| parent | f2212892b6a0c2adab438783e9fa8093c90786d7 (diff) | |
| download | linux-next-368fae47c6cae28a312c5dc86e5bdb8f9369fd26.tar.gz linux-next-368fae47c6cae28a312c5dc86e5bdb8f9369fd26.zip | |
tools/nolibc: fix WIFSIGNALED() for status 0
WIFSIGNALED() needs the subtraction to wrap around for status 0, so that
only 1 to 0xff, a terminating signal with or without the core dump flag,
pass the check. But status is an int, and 0 - 1 is -1, which is less
than 0xff. A child that exits with 0 is therefore reported as both
exited and killed, and a caller that tests WIFSIGNALED() first sees
"killed by signal 0".
Make the subtraction unsigned, as musl does in the same macro.
Fixes: 8c934d4822c7 ("tools/nolibc: add helpers for wait() signal exits")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Link: https://patch.msgid.link/20260923205622.1123270-2-danishkhateeb03@gmail.com
[Thomas: Drop stable@ Cc]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools/perf/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
