NetBSD Problem Report #56313

From www@netbsd.org  Sat Jul 17 13:43:14 2021
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))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4AA8E1A9248
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 17 Jul 2021 13:43:14 +0000 (UTC)
Message-Id: <20210717134313.18E301A9249@mollari.NetBSD.org>
Date: Sat, 17 Jul 2021 13:43:13 +0000 (UTC)
From: jilles@FreeBSD.org
Reply-To: jilles@FreeBSD.org
To: gnats-bugs@NetBSD.org
Subject: tests/lib/libc/sys/t_wait.c compares si_status incorrectly
X-Send-Pr-Version: www-1.0

>Number:         56313
>Category:       lib
>Synopsis:       tests/lib/libc/sys/t_wait.c compares si_status incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 17 13:45:00 +0000 2021
>Closed-Date:    Sat Jul 17 14:04:24 +0000 2021
>Last-Modified:  Sat Jul 17 14:05:01 +0000 2021
>Originator:     Jilles Tjoelker
>Release:        current as of 2021-07-17
>Organization:
The FreeBSD Project
>Environment:
problem found by code inspection
>Description:
In http://cvsweb.netbsd.org/bsdweb.cgi/src/tests/lib/libc/sys/t_wait.c?rev=1.9&content-type=text/x-cvsweb-markup&only_with_tag=MAIN I found the line:

ATF_REQUIRE(si.si_status = 0x5a5a5a5a);

This is supposed to check the value of si.si_status, but because there is = instead of ==, it assigns the value and does not check anything.

FreeBSD has imported this code to contrib/netbsd-tests/lib/libc/sys/t_wait.c; I originally found the issue there.
>How-To-Repeat:

>Fix:
Change = to == in this line.

I don't know whether the underlying functionality works correctly in the kernel if it is not tested.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 17 Jul 2021 14:04:24 +0000
State-Changed-Why:
Fixed, thanks for the report!


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56313 CVS commit: src/tests/lib/libc/sys
Date: Sat, 17 Jul 2021 14:03:36 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Jul 17 14:03:36 UTC 2021

 Modified Files:
 	src/tests/lib/libc/sys: t_wait.c

 Log Message:
 PR 56313: fix eroneous = that was meant to be ==


 To generate a diff of this commit:
 cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/sys/t_wait.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.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.