git: f0852209a086 - stable/13 - diff: Add test case for pagination resource leak
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Feb 2026 15:33:08 UTC
The branch stable/13 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=f0852209a086387d8171da58a09faadaf5b0a455
commit f0852209a086387d8171da58a09faadaf5b0a455
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-02-05 14:39:47 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-02-10 15:32:47 +0000
diff: Add test case for pagination resource leak
The pagination code leaks either processes or descriptors or both,
depending on the exact version of the code you have. Add a test case
which exercises this leak to facilitate fixing it.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: thj, kevans
Differential Revision: https://reviews.freebsd.org/D55111
(cherry picked from commit 270492602b9bd8b8fce4f021f055804978bf3f23)
---
usr.bin/diff/tests/diff_test.sh | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh
index 8b8846925ee8..181463ca9be7 100755
--- a/usr.bin/diff/tests/diff_test.sh
+++ b/usr.bin/diff/tests/diff_test.sh
@@ -328,6 +328,26 @@ bigu_body()
diff -U$(((1<<31)-2)) a b
}
+prleak_head()
+{
+ atf_set "descr" "Verify that pagination does not leak resources"
+}
+prleak_body()
+{
+ local n=32
+ mkdir a b
+ for hi in $(jot -w%02x $n 0) ; do
+ mkdir a/$hi b/$hi
+ for lo in $(jot -w%02x $n 0) ; do
+ echo "$hi$lo" >a/$hi/$lo
+ echo "$hi$lo" >b/$hi/$lo
+ done
+ done
+ ulimit -n 1000
+ ulimit -u 1000
+ atf_check diff -rul a b
+}
+
atf_init_test_cases()
{
atf_add_test_case simple
@@ -353,4 +373,5 @@ atf_init_test_cases()
atf_add_test_case dirloop
atf_add_test_case bigc
atf_add_test_case bigu
+ atf_add_test_case prleak
}