NetBSD Problem Report #60357

From www@netbsd.org  Tue Jun 23 17:11:10 2026
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 "R13" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7DA831A923A
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 23 Jun 2026 17:11:10 +0000 (UTC)
Message-Id: <20260623171109.74C4B1A923B@mollari.NetBSD.org>
Date: Tue, 23 Jun 2026 17:11:09 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: diff3(1): tests are failing since BSD diff import
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         60357
>Category:       bin
>Synopsis:       diff3(1): tests are failing since BSD diff import
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 23 17:15:00 +0000 2026
>Closed-Date:    Tue Jun 23 18:02:19 +0000 2026
>Last-Modified:  Tue Jun 23 18:02:19 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetBSD Diff (but NotBSDiff) Foundation
>Environment:
>Description:
Happening intermittently on various platforms, such as riscv:
https://releng.netbsd.org/b5reports/riscv-riscv64/2026/2026.06.15.06.28.55/test.html#usr.bin_diff3_t_diff3_diff3_A

Test case: usr.bin/diff3/t_diff3/diff3_A

Duration: 1.431946 seconds
Termination reason

FAILED: atf-check failed; see the output of the test for details
Standard output stream

Executing command [ diff3 -A -L 1 -L 2 -L 3 /usr/tests/usr.bin/diff3/1.txt /usr/tests/usr.bin/diff3/2.txt /usr/tests/usr.bin/diff3/3.txt ]

Standard error stream

Fail: incorrect exit status: 2, expected: 1
stdout:

stderr:
diff3: kevent2: No such process

>How-To-Repeat:
cd /usr/tests/usr.bin/diff3 && atf-run | atf-report
>Fix:
Yes, please!

>Release-Note:

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60357 CVS commit: src/usr.bin
Date: Tue, 23 Jun 2026 17:57:14 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Jun 23 17:57:14 UTC 2026

 Modified Files:
 	src/usr.bin/diff: pr.c pr.h
 	src/usr.bin/diff3: diff3.c

 Log Message:
 diff3(1): Just use waitpid(2), no need for kevent(2).

 Sidesteps

 PR kern/60358: kevent EVFILT_PROC races with process exit

 in order to fix

 PR bin/60357: diff3(1): tests are failing since BSD diff import

 The FreeBSD version used kevent(2) until February of this year:
 https://cgit.freebsd.org/src/commit/?id=404753664a5e145d98f1749d1c7bc046c8aa32c3
 So this reduces diff from FreeBSD somewhat, except FreeBSD uses
 capsicum and process fds rather than pids.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/usr.bin/diff/pr.c src/usr.bin/diff/pr.h
 cvs rdiff -u -r1.1 -r1.2 src/usr.bin/diff3/diff3.c

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

State-Changed-From-To: open->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 23 Jun 2026 18:02:19 +0000
State-Changed-Why:
fixed in HEAD, inapplicable to branches since bsd diff is so new


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 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.