Hi Bruno,
On 5/18/24 5:03 PM, Bruno Haible wrote:
>> Until then, maybe this should be added to the documentation? You
>> tested NetBSD 9.0 and NetBSD 10.0 and I reproduced on NetBSD 10.0.
>> From what I can tell from a brief look at the git history (don't know
>> how to use cvs, so github mirror) the behavior hasn't changed since it
>> was introduced in NetBSD 6.0.
>
> For our doc's purposes, the moment when the bug has been introduced in
> NetBSD is not relevant. What we document is the newest version in which
> we could reproduce the bug. Please document it!
Ah, okay that makes sense. I misunderstood the version numbers. I was
under the impression that they were when the bug was introduced.
I guess that would be a full-time job itself to maintain. And there
isn't much benefit to documenting every bug in EOL operating systems
anyways.
> And it's a good idea to reference the bug report in a comment:
> @c https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58266
> So that in the future it helps us to understand what the bug is
> about and how to reproduce it in newer versions of NetBSD.
>
> Also, you can now revert the latest commit of modules/dup3-tests.
Added documentation and removed the xfail stuff in the attached patch.
Very small so I figured a single commit is fine. On my NetBSD 10.0 VM
running:
$ gnulib-tool --create-testdir --dir testdir1 dup3
$ cd testdir1
$ make check
and everything passes.
> Thanks again!
No worries. Thank you for explaining all the doc/*, lib/*, and test/*
conventions to me. Now that gnulib-tool.py is working, outside of a
few minor bugs (e.g. gl_DOC_BASE issue in gnulib-tool.py.TODO), I can
help investigate bugs and make improvements elsewhere too.
Collin
From c7398c508d7e0222c1d7a74c14d93b23bf57fe05 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sat, 18 May 2024 17:34:09 -0700
Subject: [PATCH] dup3: Update documentation and expected test results.
* doc/glibc-functions/dup3.texi: Mention NetBSD bug fixed by the Gnulib
implementation after the previous commit.
* modules/dup3-tests (Depends-on): Remove test-xfail.
(Makefile.am): Don't expect test-dup3 to fail on NetBSD.
---
ChangeLog | 6 ++++++
doc/glibc-functions/dup3.texi | 5 +++++
modules/dup3-tests | 5 -----
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 71a111ee7d..fc2c42283c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2024-05-18 Collin Funk <collin.fu...@gmail.com>
+ dup3: Update documentation and expected test results.
+ * doc/glibc-functions/dup3.texi: Mention NetBSD bug fixed by the Gnulib
+ implementation after the previous commit.
+ * modules/dup3-tests (Depends-on): Remove test-xfail.
+ (Makefile.am): Don't expect test-dup3 to fail on NetBSD.
+
dup3: Fix behavior for equal file descriptors on NetBSD.
* lib/dup3.c (dup3) [__NetBSD__]: Check for equal file descriptors upon
a successful call to dup3. If they are equal fail with errno == EINVAL.
diff --git a/doc/glibc-functions/dup3.texi b/doc/glibc-functions/dup3.texi
index dfe47b4725..c04e6bd7a4 100644
--- a/doc/glibc-functions/dup3.texi
+++ b/doc/glibc-functions/dup3.texi
@@ -15,6 +15,11 @@ @node dup3
@item
This function can crash on some platforms:
Cygwin 1.7.25.
+
+@item
+This function mistakenly succeeds when given two equal file descriptors on some platforms:
+@c https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58266
+NetBSD 10.0.
@end itemize
Portability problems not fixed by Gnulib:
diff --git a/modules/dup3-tests b/modules/dup3-tests
index eff2e21307..7d52771730 100644
--- a/modules/dup3-tests
+++ b/modules/dup3-tests
@@ -8,14 +8,9 @@ getdtablesize
msvc-nothrow
open
close
-test-xfail
configure.ac:
Makefile.am:
TESTS += test-dup3
check_PROGRAMS += test-dup3
-
-if OS_IS_NETBSD
-XFAIL_TESTS += test-dup3
-endif
--
2.45.1