public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/bind9-next] rawhide: Switch downstream change to upstream for 32b mem check
@ 2026-06-05 10:24
0 siblings, 0 replies; only message in thread
From: @ 2026-06-05 10:24 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/bind9-next
Branch : rawhide
Commit : e6c0c1b6974349b4dd6f99d6f72c8df0659fb9b9
Author : Petr Menšík <pemensik@redhat.com>
Date : 2026-06-03T16:44:25+02:00
Stats : +67/-49 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/bind9-next/c/e6c0c1b6974349b4dd6f99d6f72c8df0659fb9b9?branch=rawhide
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 2dc204d..4939fa1 100644
--- a/bind9-next.spec
+++ b/bind9-next.spec
@@ -88,7 +88,7 @@ Patch1: bind-9.16-redhat_doc.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}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-05 10:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-05 10:24 [rpms/bind9-next] rawhide: Switch downstream change to upstream for 32b mem check
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox