intermittent memory leak in forward system test
In the test system:gcc:tsan
(job#2988101), a memory leak caused the following assertion failure during the forward
system test:
D:forward:Core was generated by `/builds/isc-private/bind9/bin/named/.libs/named -D forward-ns3 -X named.lock -m'.
D:forward:Program terminated with signal SIGABRT, Aborted.
D:forward:#0 0x00007efc51df0e7c in __pthread_kill_implementation () from /lib64/libc.so.6
D:forward:[Current thread is 1 (Thread 0x7efc516d8740 (LWP 26753))]
D:forward:#0 0x00007efc51df0e7c in __pthread_kill_implementation () from /lib64/libc.so.6
D:forward:#1 0x00007efc51da0aa6 in raise () from /lib64/libc.so.6
D:forward:#2 0x00007efc51d8a7fc in abort () from /lib64/libc.so.6
D:forward:#3 0x00007efc530ecf80 in abort () from /lib64/libtsan.so.2
D:forward:#4 0x0000000000425c31 in assertion_failed (file=<optimized out>, line=<optimized out>, type=<optimized out>, cond=<optimized out>) at main.c:237
D:forward:#5 0x00007efc52b133a9 in isc_assertion_failed (file=file@entry=0x7efc52b6d68b "mem.c", line=line@entry=688, type=type@entry=isc_assertiontype_require, cond=cond@entry=0x7efc52b6df58 "isc_refcount_current(&ctx->references) == 0") at assertions.c:49
D:forward:#6 0x00007efc52b341b1 in isc__mem_destroy (ctxp=ctxp@entry=0x4a0400 <named_g_mctx>, file=file@entry=0x7efc52b6d5ec "managers.c", line=line@entry=53) at mem.c:688
D:forward:#7 0x00007efc52b3097d in isc_managers_destroy (mctxp=mctxp@entry=0x4a0400 <named_g_mctx>, loopmgrp=loopmgrp@entry=0x4a03e0 <named_g_loopmgr>, netmgrp=netmgrp@entry=0x4a03d0 <named_g_netmgr>, taskmgrp=taskmgrp@entry=0x4a03f0 <named_g_taskmgr>) at managers.c:53
D:forward:#8 0x0000000000428edc in main (argc=16, argv=<optimized out>) at main.c:1552
Log excerpt:
12-Dec-2022 14:24:34.254 exiting
Dump of all outstanding memory allocations:
ptr 0x7b1c0000a870 size 107 file rbt.c line 1510
ptr 0x7b1000004080 size 56 file heap.c line 89
ptr 0x7b1000003dc0 size 56 file heap.c line 89
ptr 0x7b500000ac00 size 504 file rbtdb.c line 1360
ptr 0x7b5000006e00 size 504 file rbtdb.c line 8351
ptr 0x7b1400005eb0 size 72 file rbt.c line 269
ptr 0x7b0800029c40 size 32 file rbt.c line 1594
ptr 0x7b14000052d0 size 72 file rbt.c line 269
ptr 0x7b1000004180 size 56 file heap.c line 89
ptr 0x7b1c0000b0c0 size 112 file rbtdb.c line 8389
ptr 0x7b1000004100 size 56 file heap.c line 89
ptr 0x7b0800029ca0 size 32 file rbt.c line 1594
ptr 0x7b1000004b40 size 56 file heap.c line 89
ptr 0x7b2800000fa0 size 158 file rdataslab.c line 272
ptr 0x7b0800029cc0 size 32 file rbt.c line 1594
ptr 0x7b2c00019180 size 174 file rdataslab.c line 272
ptr 0x7b1000004c80 size 56 file heap.c line 89
ptr 0x7b1c00000a80 size 107 file rbt.c line 1510
ptr 0x7b5000007000 size 456 file rbtdb.c line 8305
ptr 0x7b2000012400 size 127 file rbt.c line 1510
ptr 0x7b1000004140 size 56 file heap.c line 89
ptr 0x7b14000050a0 size 72 file rbt.c line 269
ptr 0x7b3800001260 size 212 file rdataslab.c line 272
ptr 0x7b040000c3a0 size 2 file name.c line 1965
ptr 0x7b1000004b80 size 56 file rbtdb.c line 8376
mem.c:688: REQUIRE(isc_refcount_current(&ctx->references) == 0) failed
The issue seems fairly rare, since the tests passed multiple times on the same commit.