public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/bind9-next] f43: Switch downstream change to upstream for 32b mem check
Date: Fri, 05 Jun 2026 10:43:19 GMT	[thread overview]
Message-ID: <178065619989.1.5070190225900615720.rpms-bind9-next-25d3d5e459c0@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/bind9-next
            Branch : f43
            Commit : 25d3d5e459c008603e63cbed20501b1910d981ff
            Author : Petr Menšík <pemensik@redhat.com>
            Date   : 2026-06-05T12:32:14+02:00
            Stats  : +67/-49 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/bind9-next/c/25d3d5e459c008603e63cbed20501b1910d981ff?branch=f43

            Log:
            Switch downstream change to upstream for 32b mem check

Downstream fix was not working anymore and upstream fix is better.

---
diff --git a/bind-9.21-unittest-32b-mem.patch b/bind-9.21-unittest-32b-mem.patch
index 90dee92..ba4e0fd 100644
--- a/bind-9.21-unittest-32b-mem.patch
+++ b/bind-9.21-unittest-32b-mem.patch
@@ -1,91 +1,109 @@
-From e81b125a9c7eb9222b5f8298bec689e23287969b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
-Date: Thu, 9 Apr 2026 10:51:57 +0200
-Subject: [PATCH] Accept significantly lower memory consumption on 32b system
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+From 4623873e588c86c6add4d53708e754e2d6f3e087 Mon Sep 17 00:00:00 2001
+From: Michal Nowak <mnowak@isc.org>
+Date: Wed, 20 May 2026 08:59:49 +0000
+Subject: [PATCH] Make deleg cleanuptests memory assertions 32-bit-safe
 
-Memory usage might be significantly lower on legacy platforms. Allow
-testing of them and pass there. Move repeated checks to shared
-functions, include phase in minimal range to simplify identification of
-failed place.
+Each address entry stored by dns_delegset_addaddr() is an
+isc_netaddrlink_t, whose size depends on sizeof(void *) via the
+ISC_LINK macro (24 bytes of address + two prev/next pointers): 40
+bytes on 64-bit, 32 bytes on 32-bit. The hardcoded 4 MB / 8 MB
+ranges only held on 64-bit, so dns_deleg_cleanuptests failed on
+armv7l with isc_mem_inuse() returning ~3.2 MB.
 
-Signed-off-by: Petr Menšík <pemensik@redhat.com>
+Express the expected ranges in terms of sizeof(isc_netaddrlink_t)
+so they scale with pointer width, and pull the 99999 entry count
+out into a NENTRIES macro.
+
+Assisted-by: Claude:claude-opus-4-7
 ---
- tests/dns/deleg_test.c | 27 +++++++++++++++++++++------
- 1 file changed, 21 insertions(+), 6 deletions(-)
+ tests/dns/deleg_test.c | 30 ++++++++++++++++++++++--------
+ 1 file changed, 22 insertions(+), 8 deletions(-)
 
 diff --git a/tests/dns/deleg_test.c b/tests/dns/deleg_test.c
-index d3af6ab..cbab065 100644
+index d3af6aba966..9497caf2753 100644
 --- a/tests/dns/deleg_test.c
 +++ b/tests/dns/deleg_test.c
-@@ -579,6 +579,22 @@ typedef struct {
- 	isc_stdtime_t now;
- } cleanup_ctx_t;
+@@ -52,6 +52,15 @@ isc_stdtime_now(void) {
  
-+static void cleanuptests_memcheck1(isc_mem_t *mctx, unsigned int phase) {
-+	size_t inuse = isc_mem_inuse(mctx);
-+	if (sizeof(void *) == 4)
-+		assert_int_in_range(inuse, 3100000+phase, 3300000);
-+	else
-+		assert_int_in_range(inuse, 4000000+phase, 4100000);
-+}
-+
-+static void cleanuptests_memcheck2(isc_mem_t *mctx, unsigned int phase) {
-+	size_t inuse = isc_mem_inuse(mctx);
-+	if (sizeof(void *) == 4)
-+		assert_int_in_range(inuse, 6400000+phase, 6500000);
-+	else
-+		assert_int_in_range(inuse, 8000000+phase, 8100000);
-+}
+ #include <tests/isc.h>
+ 
++/*
++ * cleanuptests adds NENTRIES address entries to a delegset; each is an
++ * isc_netaddrlink_t whose size depends on sizeof(void *) via ISC_LINK.
++ * Express memory expectations in terms of that struct so the test works
++ * on both 32-bit and 64-bit targets.
++ */
++#define NENTRIES       99999
++#define ENTRIES_MEM(n) ((size_t)(n) * sizeof(isc_netaddrlink_t))
 +
  static void
- cleanuptests_phase3(void *arg) {
- 	cleanup_ctx_t *ctx = arg;
-@@ -587,7 +603,7 @@ cleanuptests_phase3(void *arg) {
+ shutdownloop(ISC_ATTR_UNUSED void *arg) {
+ 	isc_loopmgr_shutdown();
+@@ -587,7 +596,8 @@ cleanuptests_phase3(void *arg) {
  	dns_delegset_t *delegset = NULL;
  	isc_result_t result;
  
 -	assert_int_in_range(isc_mem_inuse(db->mctx), 8000000, 8100000);
-+	cleanuptests_memcheck1(db->mctx, 3);
++	assert_int_in_range(isc_mem_inuse(db->mctx), ENTRIES_MEM(2 * NENTRIES),
++			    ENTRIES_MEM(2 * NENTRIES) + 100000);
  
  	/*
  	 * baz. is there, but bar. is gone, as it has been
-@@ -612,7 +628,7 @@ cleanuptests_phase2(void *arg) {
+@@ -612,7 +622,8 @@ cleanuptests_phase2(void *arg) {
  	dns_delegset_t *delegset = NULL;
  	isc_result_t result;
  
 -	assert_int_in_range(isc_mem_inuse(db->mctx), 4000000, 4100000);
-+	cleanuptests_memcheck1(db->mctx, 2);
++	assert_int_in_range(isc_mem_inuse(db->mctx), ENTRIES_MEM(NENTRIES),
++			    ENTRIES_MEM(NENTRIES) + 100000);
  
  	/*
  	 * bar. is there
-@@ -632,7 +648,7 @@ cleanuptests_phase2(void *arg) {
- 	for (size_t i = 0; i < 99999; i++) {
+@@ -629,10 +640,11 @@ cleanuptests_phase2(void *arg) {
+ 	dns_delegset_allocdeleg(delegset, DNS_DELEGTYPE_DELEG_ADDRESSES,
+ 				&deleg);
+ 
+-	for (size_t i = 0; i < 99999; i++) {
++	for (size_t i = 0; i < NENTRIES; i++) {
  		addipdeleg(AF_INET6, "1111::2222", delegset, deleg);
  	}
 -	assert_int_in_range(isc_mem_inuse(db->mctx), 8000000, 8100000);
-+	cleanuptests_memcheck2(db->mctx, 2);
++	assert_int_in_range(isc_mem_inuse(db->mctx), ENTRIES_MEM(2 * NENTRIES),
++			    ENTRIES_MEM(2 * NENTRIES) + 100000);
  	writedb(db, "baz.", 30, &delegset, true);
  	deleg = NULL;
  
-@@ -681,8 +697,7 @@ cleanuptests(ISC_ATTR_UNUSED void *arg) {
+@@ -677,11 +689,12 @@ cleanuptests(ISC_ATTR_UNUSED void *arg) {
+ 
+ 	assert_int_in_range(isc_mem_inuse(db->mctx), 500, 2000);
+ 
+-	for (size_t i = 0; i < 99999; i++) {
++	for (size_t i = 0; i < NENTRIES; i++) {
  		addipdeleg(AF_INET6, "1111::2222", delegset, deleg);
  	}
  
 -	assert_int_in_range(isc_mem_inuse(db->mctx), 4000000, 4100000);
--
-+	cleanuptests_memcheck1(db->mctx, 1);
++	assert_int_in_range(isc_mem_inuse(db->mctx), ENTRIES_MEM(NENTRIES),
++			    ENTRIES_MEM(NENTRIES) + 100000);
+ 
  	writedb(db, "stuff.", 10, &delegset, true);
  	deleg = NULL;
- 	stdtime_now += 10;
-@@ -703,7 +718,7 @@ cleanuptests(ISC_ATTR_UNUSED void *arg) {
+@@ -694,7 +707,7 @@ cleanuptests(ISC_ATTR_UNUSED void *arg) {
+ 	dns_delegset_allocdeleg(delegset, DNS_DELEGTYPE_DELEG_ADDRESSES,
+ 				&deleg);
+ 
+-	for (size_t i = 0; i < 99999; i++) {
++	for (size_t i = 0; i < NENTRIES; i++) {
+ 		addipdeleg(AF_INET6, "1111::2222", delegset, deleg);
+ 	}
+ 
+@@ -703,7 +716,8 @@ cleanuptests(ISC_ATTR_UNUSED void *arg) {
  	 * with DB mem context) overmem conditions will be detected, and the
  	 * expired node will be removed
  	 */
 -	assert_int_in_range(isc_mem_inuse(db->mctx), 8000000, 8100000);
-+	cleanuptests_memcheck2(db->mctx, 1);
++	assert_int_in_range(isc_mem_inuse(db->mctx), ENTRIES_MEM(2 * NENTRIES),
++			    ENTRIES_MEM(2 * NENTRIES) + 100000);
  	writedb(db, "bar.", 30, &delegset, true);
  	deleg = NULL;
  

diff --git a/bind9-next.spec b/bind9-next.spec
index 6e8c9df..10c8946 100644
--- a/bind9-next.spec
+++ b/bind9-next.spec
@@ -91,7 +91,7 @@ Patch3: bind-9.21-unittest-isc_rwlock-s390x.patch
 # https://gitlab.isc.org/isc-projects/bind9/-/issues/5328
 # avoid often fails on i386, unsupported upstream
 Patch4: bind-9.21-unittest-qpdb-i386.patch
-# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/11825
+# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/12061
 Patch5: bind-9.21-unittest-32b-mem.patch
 
 %{?systemd_ordering}

                 reply	other threads:[~2026-06-05 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178065619989.1.5070190225900615720.rpms-bind9-next-25d3d5e459c0@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox