NetBSD Problem Report #59289

From www@netbsd.org  Sun Apr 13 14:57:11 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BB2861A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 13 Apr 2025 14:57:11 +0000 (UTC)
Message-Id: <20250413145710.1C9871A923D@mollari.NetBSD.org>
Date: Sun, 13 Apr 2025 14:57:10 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: atf should report more detailed signal info on crash
X-Send-Pr-Version: www-1.0

>Number:         59289
>Category:       bin
>Synopsis:       atf should report more detailed signal info on crash
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 13 15:00:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The NetATF Foundasignal
>Environment:
>Description:
When a test program terminates on a signal, atf just prints the signal number, e.g.:

Test case: lib/libc/regex/t_exhaust/regcomp_too_big

Duration: 26.751680 seconds
Termination reason

FAILED: Test program received signal 9

https://releng.netbsd.org/b5reports/evbarm-aarch64/2025/2025.04.11.23.57.21/test.html#lib_libc_regex_t_exhaust_regcomp_too_big

It would be nice if it additionally printed:

- the identifier of the signal (SIGKILL, in this case, for those of us who can't remember the numbers -- OK, I remember 9 is SIGKILL, but not the other ones)
- the short description of the signal (SIGKILL is `Killed'; SIGFPE is `Floating-point exception'; &c.)
- relevant information from the siginfo_t
>How-To-Repeat:
browse atf reports with terse signal termination information
>Fix:
Yes, please!

The identifier is available (minus the `SIG' prefix) via signalname(3) in NetBSD, or via sig2str in POSIX.1-2024 (not yet implemented in NetBSD):

https://man.NetBSD.org/signalname.3
https://pubs.opengroup.org/onlinepubs/9799919799/functions/sig2str.html

The short description is available via the array sys_siglist of length sys_nsiglist, indexed by the signal number, in NetBSD.  Not sure if there's any portable analogue of this.

https://man.netbsd.org/sys_siglist.3

The siginfo_t is more elaborate and documentd in the siginfo(3) man page:

https://man.netbsd.org/siginfo.2

This is helpful for quickly identifying types of crashes, like alignment errors vs hardware mapping errors, unmapped access vs forbidden access, &c., and at what address the error happened.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.