From 4b3d0c66009d30f5c0bc12ee128fc59f1d853f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 11 May 2021 12:59:35 +0200 Subject: [PATCH] Remove ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGRECORD The ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGCTX did sanity checks on matching size and memory context on the memory returned to the allocator. Those will no longer needed when most of the allocator will be replaced with jemalloc. --- bin/check/named-checkconf.c | 6 -- bin/dnssec/dnssec-keygen.c | 6 -- bin/dnssec/dnssec-signzone.c | 6 -- bin/dnssec/dnssec-verify.c | 6 -- bin/named/main.c | 2 - bin/tests/system/README | 2 +- bin/tests/system/additional/ns1/named.args | 2 +- bin/tests/system/allow-query/ns3/named.args | 2 +- bin/tests/system/cacheclean/ns1/named.args | 2 +- bin/tests/system/cacheclean/ns2/named.args | 2 +- bin/tests/system/delzone/ns2/named.args | 2 +- bin/tests/system/dnssec/ns6/named.args | 2 +- bin/tests/system/dnstap/ns3/named.args | 2 +- bin/tests/system/dscp/ns1/named.args | 2 +- bin/tests/system/dscp/ns2/named.args | 2 +- bin/tests/system/dscp/ns3/named.args | 2 +- bin/tests/system/dscp/ns4/named.args | 2 +- bin/tests/system/dscp/ns5/named.args | 2 +- bin/tests/system/dscp/ns6/named.args | 2 +- bin/tests/system/dscp/ns7/named.args | 2 +- bin/tests/system/dupsigs/ns1/named.args | 2 +- bin/tests/system/fetchlimit/ns3/named.args | 2 +- bin/tests/system/legacy/ns4/named.args | 2 +- bin/tests/system/legacy/ns5/named.args | 2 +- bin/tests/system/legacy/ns6/named.args | 2 +- bin/tests/system/legacy/ns7/named.args | 2 +- bin/tests/system/logfileconfig/tests.sh | 2 +- bin/tests/system/mirror/ns3/named.args | 2 +- bin/tests/system/mkeys/ns2/named.args | 2 +- bin/tests/system/mkeys/ns3/named.args | 2 +- bin/tests/system/mkeys/ns5/named1.args | 2 +- bin/tests/system/mkeys/ns5/named2.args | 2 +- bin/tests/system/mkeys/ns6/named.args | 2 +- bin/tests/system/nsupdate/ns5/named.args | 2 +- bin/tests/system/nsupdate/ns6/named.args | 2 +- bin/tests/system/resolver/tests.sh | 2 +- bin/tests/system/rpzextra/ns1/named.args | 2 +- bin/tests/system/runtime/tests.sh | 2 +- bin/tests/system/start.pl | 2 +- bin/tests/system/timeouts/ns1/named.args | 2 +- bin/tests/system/zero/ns2/named.args | 2 +- bin/tests/system/zero/ns3/named.args | 2 +- bin/tests/system/zero/ns4/named.args | 2 +- bin/tests/wire_test.c | 6 -- lib/isc/include/isc/mem.h | 10 ---- lib/isc/mem.c | 62 +-------------------- lib/isc/tls.c | 6 +- lib/isc/trampoline.c | 16 ++---- 48 files changed, 47 insertions(+), 155 deletions(-) diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c index 11303e9648..d1f4e037d3 100644 --- a/bin/check/named-checkconf.c +++ b/bin/check/named-checkconf.c @@ -611,12 +611,6 @@ main(int argc, char **argv) { { isc_mem_debugging |= ISC_MEM_DEBUGUSAGE; } - if (strcasecmp(isc_commandline_argument, "size") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGSIZE; - } - if (strcasecmp(isc_commandline_argument, "mctx") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGCTX; - } break; default: break; diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c index 349aa00f43..c9bf49f4fe 100644 --- a/bin/dnssec/dnssec-keygen.c +++ b/bin/dnssec/dnssec-keygen.c @@ -909,12 +909,6 @@ main(int argc, char **argv) { { isc_mem_debugging |= ISC_MEM_DEBUGUSAGE; } - if (strcasecmp(isc_commandline_argument, "size") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGSIZE; - } - if (strcasecmp(isc_commandline_argument, "mctx") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGCTX; - } break; default: break; diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index 4329fe7f0a..e321295684 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -3335,12 +3335,6 @@ main(int argc, char *argv[]) { { isc_mem_debugging |= ISC_MEM_DEBUGUSAGE; } - if (strcasecmp(isc_commandline_argument, "size") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGSIZE; - } - if (strcasecmp(isc_commandline_argument, "mctx") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGCTX; - } break; default: break; diff --git a/bin/dnssec/dnssec-verify.c b/bin/dnssec/dnssec-verify.c index eb845ffbc8..a5ed08742f 100644 --- a/bin/dnssec/dnssec-verify.c +++ b/bin/dnssec/dnssec-verify.c @@ -209,12 +209,6 @@ main(int argc, char *argv[]) { { isc_mem_debugging |= ISC_MEM_DEBUGUSAGE; } - if (strcasecmp(isc_commandline_argument, "size") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGSIZE; - } - if (strcasecmp(isc_commandline_argument, "mctx") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGCTX; - } break; default: break; diff --git a/bin/named/main.c b/bin/named/main.c index 9fc84deef1..565246d772 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -430,8 +430,6 @@ static struct flag_def { { "trace", ISC_MEM_DEBUGTRACE, false }, { "record", ISC_MEM_DEBUGRECORD, false }, { "usage", ISC_MEM_DEBUGUSAGE, false }, - { "size", ISC_MEM_DEBUGSIZE, false }, - { "mctx", ISC_MEM_DEBUGCTX, false }, { NULL, 0, false } }, mem_context_flags[] = { { "fill", ISC_MEMFLAG_FILL, false }, { "nofill", ISC_MEMFLAG_FILL, true }, diff --git a/bin/tests/system/README b/bin/tests/system/README index c0970ebd32..f24bd0365e 100644 --- a/bin/tests/system/README +++ b/bin/tests/system/README @@ -546,7 +546,7 @@ By default, start.pl starts a "named" server with the following options: -g Runs the server in the foreground and logs everything to stderr. - -m record,size,mctx + -m record Turns on these memory usage debugging flags. -U 4 Uses four listeners. diff --git a/bin/tests/system/additional/ns1/named.args b/bin/tests/system/additional/ns1/named.args index 15aa849355..45ac93a7c7 100644 --- a/bin/tests/system/additional/ns1/named.args +++ b/bin/tests/system/additional/ns1/named.args @@ -1,2 +1,2 @@ # this server runs named with only one worker thread --m record,size,mctx -c named.conf -d 99 -D additional-ns1 -X named.lock -g -n 1 -T maxcachesize=2097152 +-m record -c named.conf -d 99 -D additional-ns1 -X named.lock -g -n 1 -T maxcachesize=2097152 diff --git a/bin/tests/system/allow-query/ns3/named.args b/bin/tests/system/allow-query/ns3/named.args index 35e99d8dd8..e875a57bc7 100644 --- a/bin/tests/system/allow-query/ns3/named.args +++ b/bin/tests/system/allow-query/ns3/named.args @@ -1,2 +1,2 @@ # this server only has 127.0.0.1 in its localhost/localnets ACLs --m record,size,mctx -c named.conf -d 99 -D allow-query-ns3 -X named.lock -g -T maxcachesize=2097152 -T fixedlocal +-m record -c named.conf -d 99 -D allow-query-ns3 -X named.lock -g -T maxcachesize=2097152 -T fixedlocal diff --git a/bin/tests/system/cacheclean/ns1/named.args b/bin/tests/system/cacheclean/ns1/named.args index 2ba9a1403d..b7ce00d2b7 100644 --- a/bin/tests/system/cacheclean/ns1/named.args +++ b/bin/tests/system/cacheclean/ns1/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 1 -D cacheclean-ns1 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 1 -D cacheclean-ns1 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/cacheclean/ns2/named.args b/bin/tests/system/cacheclean/ns2/named.args index 1bcc5eab28..071016c00b 100644 --- a/bin/tests/system/cacheclean/ns2/named.args +++ b/bin/tests/system/cacheclean/ns2/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 3 -D cacheclean-ns2 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 3 -D cacheclean-ns2 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/delzone/ns2/named.args b/bin/tests/system/delzone/ns2/named.args index be9241ed54..6ee0d9fe9a 100644 --- a/bin/tests/system/delzone/ns2/named.args +++ b/bin/tests/system/delzone/ns2/named.args @@ -1 +1 @@ --D delzone-ns2 -X named.lock -m record,size,mctx -c named.conf -g -U 4 -T maxcachesize=2097152 +-D delzone-ns2 -X named.lock -m record -c named.conf -g -U 4 -T maxcachesize=2097152 diff --git a/bin/tests/system/dnssec/ns6/named.args b/bin/tests/system/dnssec/ns6/named.args index 65b7dbcc93..4b96405caa 100644 --- a/bin/tests/system/dnssec/ns6/named.args +++ b/bin/tests/system/dnssec/ns6/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dnssec-ns6 -X named.lock -g -T maxcachesize=2097152 -T nonearest -T tat=1 +-m record -c named.conf -d 99 -D dnssec-ns6 -X named.lock -g -T maxcachesize=2097152 -T nonearest -T tat=1 diff --git a/bin/tests/system/dnstap/ns3/named.args b/bin/tests/system/dnstap/ns3/named.args index fb42af211a..7937dee5fb 100644 --- a/bin/tests/system/dnstap/ns3/named.args +++ b/bin/tests/system/dnstap/ns3/named.args @@ -1,2 +1,2 @@ # Using "-n 1" allows GL #1795 to be reliably reproduced --D dnstap-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -n 1 -T maxcachesize=2097152 +-D dnstap-ns3 -X named.lock -m record -c named.conf -d 99 -g -U 4 -n 1 -T maxcachesize=2097152 diff --git a/bin/tests/system/dscp/ns1/named.args b/bin/tests/system/dscp/ns1/named.args index 0c955c704a..2a3e86a26d 100644 --- a/bin/tests/system/dscp/ns1/named.args +++ b/bin/tests/system/dscp/ns1/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns1 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns1 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dscp/ns2/named.args b/bin/tests/system/dscp/ns2/named.args index ff501a812c..7122b39537 100644 --- a/bin/tests/system/dscp/ns2/named.args +++ b/bin/tests/system/dscp/ns2/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns2 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns2 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dscp/ns3/named.args b/bin/tests/system/dscp/ns3/named.args index 3d1981fb59..60ae7f4f91 100644 --- a/bin/tests/system/dscp/ns3/named.args +++ b/bin/tests/system/dscp/ns3/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns3 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns3 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dscp/ns4/named.args b/bin/tests/system/dscp/ns4/named.args index 277a47b628..8352455c09 100644 --- a/bin/tests/system/dscp/ns4/named.args +++ b/bin/tests/system/dscp/ns4/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dscp/ns5/named.args b/bin/tests/system/dscp/ns5/named.args index c678163f37..4f0c842128 100644 --- a/bin/tests/system/dscp/ns5/named.args +++ b/bin/tests/system/dscp/ns5/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dscp/ns6/named.args b/bin/tests/system/dscp/ns6/named.args index 283cf22011..a5a278df09 100644 --- a/bin/tests/system/dscp/ns6/named.args +++ b/bin/tests/system/dscp/ns6/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dscp/ns7/named.args b/bin/tests/system/dscp/ns7/named.args index 4ccf38ea05..733a65e4f7 100644 --- a/bin/tests/system/dscp/ns7/named.args +++ b/bin/tests/system/dscp/ns7/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D dscp-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 +-m record -c named.conf -d 99 -D dscp-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46 diff --git a/bin/tests/system/dupsigs/ns1/named.args b/bin/tests/system/dupsigs/ns1/named.args index 231eed4902..adf6968f86 100644 --- a/bin/tests/system/dupsigs/ns1/named.args +++ b/bin/tests/system/dupsigs/ns1/named.args @@ -1 +1 @@ --D dupsigs-ns1 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T sigvalinsecs +-D dupsigs-ns1 -X named.lock -m record -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T sigvalinsecs diff --git a/bin/tests/system/fetchlimit/ns3/named.args b/bin/tests/system/fetchlimit/ns3/named.args index 6bd3e6cf64..d3488cefe1 100644 --- a/bin/tests/system/fetchlimit/ns3/named.args +++ b/bin/tests/system/fetchlimit/ns3/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 1 -D fetchlimit-ns3 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 1 -D fetchlimit-ns3 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/legacy/ns4/named.args b/bin/tests/system/legacy/ns4/named.args index 0fe6774329..4ccb648595 100644 --- a/bin/tests/system/legacy/ns4/named.args +++ b/bin/tests/system/legacy/ns4/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D legacy-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns +-m record -c named.conf -d 99 -D legacy-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns diff --git a/bin/tests/system/legacy/ns5/named.args b/bin/tests/system/legacy/ns5/named.args index 364370a18b..0c5e17a940 100644 --- a/bin/tests/system/legacy/ns5/named.args +++ b/bin/tests/system/legacy/ns5/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D legacy-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns +-m record -c named.conf -d 99 -D legacy-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns diff --git a/bin/tests/system/legacy/ns6/named.args b/bin/tests/system/legacy/ns6/named.args index 64e5524324..3475121784 100644 --- a/bin/tests/system/legacy/ns6/named.args +++ b/bin/tests/system/legacy/ns6/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D legacy-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512 +-m record -c named.conf -d 99 -D legacy-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512 diff --git a/bin/tests/system/legacy/ns7/named.args b/bin/tests/system/legacy/ns7/named.args index e491a95dc6..1da498080f 100644 --- a/bin/tests/system/legacy/ns7/named.args +++ b/bin/tests/system/legacy/ns7/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D legacy-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512 +-m record -c named.conf -d 99 -D legacy-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512 diff --git a/bin/tests/system/logfileconfig/tests.sh b/bin/tests/system/logfileconfig/tests.sh index e1d26a7d29..191680873e 100644 --- a/bin/tests/system/logfileconfig/tests.sh +++ b/bin/tests/system/logfileconfig/tests.sh @@ -35,7 +35,7 @@ DLFILE="named_deflog" PIDFILE="${THISDIR}/${CONFDIR}/named.pid" myRNDC="$RNDC -c ${THISDIR}/${CONFDIR}/rndc.conf" -myNAMED="$NAMED -c ${THISDIR}/${CONFDIR}/named.conf -m record,size,mctx -T nosyslog -d 99 -D logfileconfig-ns1 -X named.lock -U 4" +myNAMED="$NAMED -c ${THISDIR}/${CONFDIR}/named.conf -m record -T nosyslog -d 99 -D logfileconfig-ns1 -X named.lock -U 4" # Test given condition. If true, test again after a second. Used for testing # filesystem-dependent conditions in order to prevent false negatives caused by diff --git a/bin/tests/system/mirror/ns3/named.args b/bin/tests/system/mirror/ns3/named.args index 7519c8f587..78f3feba8f 100644 --- a/bin/tests/system/mirror/ns3/named.args +++ b/bin/tests/system/mirror/ns3/named.args @@ -1 +1 @@ --D mirror-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T tat=3 +-D mirror-ns3 -X named.lock -m record -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T tat=3 diff --git a/bin/tests/system/mkeys/ns2/named.args b/bin/tests/system/mkeys/ns2/named.args index 2f752bd79b..e588c91b48 100644 --- a/bin/tests/system/mkeys/ns2/named.args +++ b/bin/tests/system/mkeys/ns2/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D mkeys-ns2 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 -T tat=1 +-m record -c named.conf -d 99 -D mkeys-ns2 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 -T tat=1 diff --git a/bin/tests/system/mkeys/ns3/named.args b/bin/tests/system/mkeys/ns3/named.args index 2015ee509a..28396c356c 100644 --- a/bin/tests/system/mkeys/ns3/named.args +++ b/bin/tests/system/mkeys/ns3/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -D mkeys-ns3 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 +-m record -c named.conf -d 99 -D mkeys-ns3 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 diff --git a/bin/tests/system/mkeys/ns5/named1.args b/bin/tests/system/mkeys/ns5/named1.args index c4c8a55817..6eeaa29006 100644 --- a/bin/tests/system/mkeys/ns5/named1.args +++ b/bin/tests/system/mkeys/ns5/named1.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/mkeys/ns5/named2.args b/bin/tests/system/mkeys/ns5/named2.args index 3fd830afbb..34ac30d937 100644 --- a/bin/tests/system/mkeys/ns5/named2.args +++ b/bin/tests/system/mkeys/ns5/named2.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=2/20/40 +-m record -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=2/20/40 diff --git a/bin/tests/system/mkeys/ns6/named.args b/bin/tests/system/mkeys/ns6/named.args index 65a8fcaa97..7ef5cf02f9 100644 --- a/bin/tests/system/mkeys/ns6/named.args +++ b/bin/tests/system/mkeys/ns6/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 +-m record -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 diff --git a/bin/tests/system/nsupdate/ns5/named.args b/bin/tests/system/nsupdate/ns5/named.args index a1ebb6f763..fc5a5cd2a7 100644 --- a/bin/tests/system/nsupdate/ns5/named.args +++ b/bin/tests/system/nsupdate/ns5/named.args @@ -1 +1 @@ --D nsupdate-ns5 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal +-D nsupdate-ns5 -m record -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal diff --git a/bin/tests/system/nsupdate/ns6/named.args b/bin/tests/system/nsupdate/ns6/named.args index 11e5449526..48e2bd82c6 100644 --- a/bin/tests/system/nsupdate/ns6/named.args +++ b/bin/tests/system/nsupdate/ns6/named.args @@ -1 +1 @@ --D nsupdate-ns6 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal +-D nsupdate-ns6 -m record -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index a958103c0a..435501c2a4 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -833,7 +833,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "check logged command line ($n)" ret=0 -grep "running as: .* -m record,size,mctx " ns1/named.run > /dev/null || ret=1 +grep "running as: .* -m record " ns1/named.run > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/rpzextra/ns1/named.args b/bin/tests/system/rpzextra/ns1/named.args index b289924b27..970fc22639 100644 --- a/bin/tests/system/rpzextra/ns1/named.args +++ b/bin/tests/system/rpzextra/ns1/named.args @@ -1 +1 @@ - -m record,size,mctx -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -T maxcachesize=2097152 + -m record -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -T maxcachesize=2097152 diff --git a/bin/tests/system/runtime/tests.sh b/bin/tests/system/runtime/tests.sh index 5cc11015a0..ddbdc10a80 100644 --- a/bin/tests/system/runtime/tests.sh +++ b/bin/tests/system/runtime/tests.sh @@ -15,7 +15,7 @@ set -e RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s" -NAMED_DEFAULT_ARGS="-m record,size,mctx -d 99 -g -U 4" +NAMED_DEFAULT_ARGS="-m record -d 99 -g -U 4" kill_named() { pidfile="${1}" diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index 89807d0cd0..307fd25d5f 100755 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -267,7 +267,7 @@ sub construct_ns_command { } else { $command .= "-D $test-$server "; $command .= "-X named.lock "; - $command .= "-m record,size,mctx "; + $command .= "-m record "; foreach my $t_option( "dropedns", "ednsformerr", "ednsnotimp", "ednsrefused", diff --git a/bin/tests/system/timeouts/ns1/named.args b/bin/tests/system/timeouts/ns1/named.args index 2df2be2737..437a77f0f4 100644 --- a/bin/tests/system/timeouts/ns1/named.args +++ b/bin/tests/system/timeouts/ns1/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 1 -D timeouts-ns1 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 1 -D timeouts-ns1 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/zero/ns2/named.args b/bin/tests/system/zero/ns2/named.args index b20594ea45..4b7aad606a 100644 --- a/bin/tests/system/zero/ns2/named.args +++ b/bin/tests/system/zero/ns2/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 1 -D zero-ns2 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 1 -D zero-ns2 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/zero/ns3/named.args b/bin/tests/system/zero/ns3/named.args index 9d89bd697c..e6f6060089 100644 --- a/bin/tests/system/zero/ns3/named.args +++ b/bin/tests/system/zero/ns3/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 1 -D zero-ns3 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 1 -D zero-ns3 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/system/zero/ns4/named.args b/bin/tests/system/zero/ns4/named.args index 09d1fe01fc..bd59f13b6c 100644 --- a/bin/tests/system/zero/ns4/named.args +++ b/bin/tests/system/zero/ns4/named.args @@ -1 +1 @@ --m record,size,mctx -c named.conf -d 1 -D zero-ns4 -X named.lock -g -T maxcachesize=2097152 +-m record -c named.conf -d 1 -D zero-ns4 -X named.lock -g -T maxcachesize=2097152 diff --git a/bin/tests/wire_test.c b/bin/tests/wire_test.c index ef86a1e7c5..7b290f8cd9 100644 --- a/bin/tests/wire_test.c +++ b/bin/tests/wire_test.c @@ -130,12 +130,6 @@ main(int argc, char *argv[]) { { isc_mem_debugging |= ISC_MEM_DEBUGUSAGE; } - if (strcasecmp(isc_commandline_argument, "size") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGSIZE; - } - if (strcasecmp(isc_commandline_argument, "mctx") == 0) { - isc_mem_debugging |= ISC_MEM_DEBUGCTX; - } break; default: break; diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h index a5f003bdce..945151e0f2 100644 --- a/lib/isc/include/isc/mem.h +++ b/lib/isc/include/isc/mem.h @@ -43,8 +43,6 @@ extern unsigned int isc_mem_defaultflags; #define ISC_MEM_DEBUGTRACE 0x00000001U #define ISC_MEM_DEBUGRECORD 0x00000002U #define ISC_MEM_DEBUGUSAGE 0x00000004U -#define ISC_MEM_DEBUGSIZE 0x00000008U -#define ISC_MEM_DEBUGCTX 0x00000010U #define ISC_MEM_DEBUGALL 0x0000001FU /*!< * The variable isc_mem_debugging holds a set of flags for @@ -63,14 +61,6 @@ extern unsigned int isc_mem_defaultflags; * \li #ISC_MEM_DEBUGUSAGE * If a hi_water mark is set, print the maximum inuse memory * every time it is raised once it exceeds the hi_water mark. - * - * \li #ISC_MEM_DEBUGSIZE - * Check the size argument being passed to isc_mem_put() matches - * that passed to isc_mem_get(). - * - * \li #ISC_MEM_DEBUGCTX - * Check the mctx argument being passed to isc_mem_put() matches - * that passed to isc_mem_get(). */ /*@}*/ diff --git a/lib/isc/mem.c b/lib/isc/mem.c index 70dae2c471..12a866e07a 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -604,28 +604,11 @@ isc__mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) { isc_mem_t *ctx = *ctxp; *ctxp = NULL; - if (ISC_UNLIKELY((isc_mem_debugging & - (ISC_MEM_DEBUGSIZE | ISC_MEM_DEBUGCTX)) != 0)) - { - if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) { - size_info *si = &(((size_info *)ptr)[-1]); - size_t oldsize = si->size - ALIGNMENT_SIZE; - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) { - oldsize -= ALIGNMENT_SIZE; - } - INSIST(oldsize == size); - } - isc__mem_free(ctx, ptr FLARG_PASS); - - goto destroy; - } - DELETE_TRACE(ctx, ptr, size, file, line); mem_putstats(ctx, ptr, size); mem_put(ctx, ptr, size); -destroy: if (isc_refcount_decrement(&ctx->references) == 1) { isc_refcount_destroy(&ctx->references); destroy(ctx); @@ -717,12 +700,6 @@ isc__mem_get(isc_mem_t *ctx, size_t size FLARG) { void *ptr; bool call_water = false; - if (ISC_UNLIKELY((isc_mem_debugging & - (ISC_MEM_DEBUGSIZE | ISC_MEM_DEBUGCTX)) != 0)) - { - return (isc__mem_allocate(ctx, size FLARG_PASS)); - } - ptr = mem_get(ctx, size); mem_getstats(ctx, size); @@ -743,23 +720,6 @@ isc__mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG) { REQUIRE(ptr != NULL); bool call_water = false; - size_info *si; - - if (ISC_UNLIKELY((isc_mem_debugging & - (ISC_MEM_DEBUGSIZE | ISC_MEM_DEBUGCTX)) != 0)) - { - if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) { - size_t oldsize; - si = &(((size_info *)ptr)[-1]); - oldsize = si->size - ALIGNMENT_SIZE; - if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) { - oldsize -= ALIGNMENT_SIZE; - } - INSIST(oldsize == size); - } - isc__mem_free(ctx, ptr FLARG_PASS); - return; - } DELETE_TRACE(ctx, ptr, size, file, line); @@ -894,16 +854,9 @@ mem_allocateunlocked(isc_mem_t *ctx, size_t size) { size_info *si; size += ALIGNMENT_SIZE; - if (ISC_UNLIKELY((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)) { - size += ALIGNMENT_SIZE; - } si = mem_get(ctx, size); - if (ISC_UNLIKELY((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)) { - si->ctx = ctx; - si++; - } si->size = size; return (&si[1]); } @@ -955,11 +908,6 @@ isc__mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG) { oldsize = (((size_info *)ptr)[-1]).size; INSIST(oldsize >= ALIGNMENT_SIZE); oldsize -= ALIGNMENT_SIZE; - if (ISC_UNLIKELY((isc_mem_debugging & - ISC_MEM_DEBUGCTX) != 0)) { - INSIST(oldsize >= ALIGNMENT_SIZE); - oldsize -= ALIGNMENT_SIZE; - } copysize = (oldsize > size) ? size : oldsize; memmove(new_ptr, ptr, copysize); isc__mem_free(ctx, ptr FLARG_PASS); @@ -980,14 +928,8 @@ isc__mem_free(isc_mem_t *ctx, void *ptr FLARG) { size_t size; bool call_water = false; - if (ISC_UNLIKELY((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)) { - si = &(((size_info *)ptr)[-2]); - REQUIRE(si->ctx == ctx); - size = si[1].size; - } else { - si = &(((size_info *)ptr)[-1]); - size = si->size; - } + si = &(((size_info *)ptr)[-1]); + size = si->size; DELETE_TRACE(ctx, ptr, size, file, line); diff --git a/lib/isc/tls.c b/lib/isc/tls.c index cf947fa645..ad0cb74168 100644 --- a/lib/isc/tls.c +++ b/lib/isc/tls.c @@ -72,11 +72,7 @@ tls_initialize(void) { /* * We can't use isc_mem API here, because it's called too * early and when the isc_mem_debugging flags are changed - * later and ISC_MEM_DEBUGSIZE or ISC_MEM_DEBUGCTX flags are - * added, neither isc_mem_put() nor isc_mem_free() can be used - * to free up the memory allocated here because the flags were - * not set when calling isc_mem_get() or isc_mem_allocate() - * here. + * later. * * Actually, since this is a single allocation at library load * and deallocation at library unload, using the standard diff --git a/lib/isc/trampoline.c b/lib/isc/trampoline.c index 009e8d136b..5d0429dfe9 100644 --- a/lib/isc/trampoline.c +++ b/lib/isc/trampoline.c @@ -40,17 +40,13 @@ static size_t isc__trampoline_min = 1; static size_t isc__trampoline_max = 65; /* - * We can't use isc_mem API here, because it's called too - * early and when the isc_mem_debugging flags are changed - * later and ISC_MEM_DEBUGSIZE or ISC_MEM_DEBUGCTX flags are - * added, neither isc_mem_put() nor isc_mem_free() can be used - * to free up the memory allocated here because the flags were - * not set when calling isc_mem_get() or isc_mem_allocate() - * here. + * We can't use isc_mem API here, because it's called too early and the + * isc_mem_debugging flags can be changed later causing mismatch between flags + * used for isc_mem_get() and isc_mem_put(). * - * Actually, since this is a single allocation at library load - * and deallocation at library unload, using the standard - * allocator without the tracking is fine for this purpose. + * Since this is a single allocation at library load and deallocation at library + * unload, using the standard allocator without the tracking is fine for this + * single purpose. */ static isc__trampoline_t * isc__trampoline_new(int tid, isc_threadfunc_t start, isc_threadarg_t arg) {