NetBSD Problem Report #59300

From www@netbsd.org  Wed Apr 16 01:21:53 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)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E283B1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 16 Apr 2025 01:21:52 +0000 (UTC)
Message-Id: <20250416012151.D5F2E1A923D@mollari.NetBSD.org>
Date: Wed, 16 Apr 2025 01:21:51 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: timer/timerfd invalidtime tests are failing
X-Send-Pr-Version: www-1.0

>Number:         59300
>Category:       misc
>Synopsis:       timer/timerfd invalidtime tests are failing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    riastradh
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 16 01:25:00 +0000 2025
>Closed-Date:    
>Last-Modified:  Wed Apr 16 01:50:01 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, maybe 10 or 9 if pulled up
>Organization:
The InvalidBSD Timertestation
>Environment:
>Description:
The t_timer_create:timer_invalidtime and t_timerfd:timerfd_invalidtime tests are failing on riscv and alpha:

https://releng.netbsd.org/b5reports/riscv-riscv64/2025/2025.04.14.16.43.01/test.html#lib_libc_sys_t_timer_create_timer_invalidtime
https://releng.netbsd.org/b5reports/alpha/2025/2025.04.15.10.10.36/test.html#lib_libc_sys_t_timer_create_timer_invalidtime

On review of the tests, it looks like they rely on uninitialized data -- and possibly just don't make sense at all for some cases because -1 + now.tv_sec + 60 is likely to be a valid number of seconds in the future anyway:

    445 		struct itimerspec its;
    446 
    447 		fprintf(stderr, "case %u\n", i);
    448 
    449 		ATF_CHECK_ERRNO(EINVAL,
    450 		    timer_settime(t, 0, &einval_its[i], NULL) == -1);
    451 
    452 		/* Try the same with an absolute time near now. */
    453 		its.it_value = einval_its[i].it_value;
    454 		its.it_value.tv_sec += now.tv_sec + 60;
    455 		ATF_CHECK_ERRNO(EINVAL,
    456 		    timer_settime(t, TIMER_ABSTIME, &its, NULL) == -1);
>How-To-Repeat:
cd /usr/tests/lib/libc/sys
atf-run t_timer_create t_timerfd | atf-report
>Fix:
Yes, please!

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: misc-bug-people->riastradh
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Wed, 16 Apr 2025 01:35:29 +0000
Responsible-Changed-Why:
my bug, my fix


State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Wed, 16 Apr 2025 01:35:29 +0000
State-Changed-Why:
fixed in HEAD, needs pullups if pullups are done for
PR kern/58917
PR kern/58919
PR kern/58920
(which added this test in the first place)


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59300 CVS commit: src/tests/lib/libc/sys
Date: Wed, 16 Apr 2025 01:32:48 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Wed Apr 16 01:32:48 UTC 2025

 Modified Files:
 	src/tests/lib/libc/sys: t_timer_create.c t_timerfd.c

 Log Message:
 t_timer_create, t_timerfd: Make the invalidtime tests make sense.

 Don't use uninitialized memory.  Skip the absolute test when it's
 just a time in the past (which should expire immediately), not an
 invalid time.

 PR misc/59300: timer/timerfd invalidtime tests are failing


 To generate a diff of this commit:
 cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/sys/t_timer_create.c
 cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libc/sys/t_timerfd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.49 2026/05/14 01:52:41 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.