bind9/lib/ns/tests
Evan Hunt 86eddebc83 Purge memory pool upon plugin destruction
The typical sequence of events for AAAA queries which trigger recursion
for an A RRset at the same name is as follows:

 1. Original query context is created.
 2. An AAAA RRset is found in cache.
 3. Client-specific data is allocated from the filter-aaaa memory pool.
 4. Recursion is triggered for an A RRset.
 5. Original query context is torn down.

 6. Recursion for an A RRset completes.
 7. A second query context is created.
 8. Client-specific data is retrieved from the filter-aaaa memory pool.
 9. The response to be sent is processed according to configuration.
10. The response is sent.
11. Client-specific data is returned to the filter-aaaa memory pool.
12. The second query context is torn down.

However, steps 6-12 are not executed if recursion for an A RRset is
canceled.  Thus, if named is in the process of recursing for A RRsets
when a shutdown is requested, the filter-aaaa memory pool will have
outstanding allocations which will never get released.  This in turn
leads to a crash since every memory pool must not have any outstanding
allocations by the time isc_mempool_destroy() is called.

Fix by creating a stub query context whenever fetch_callback() is called,
including cancellation events. When the qctx is destroyed, it will ensure
the client is detached and the plugin memory is freed.
2020-09-25 13:32:34 -07:00
..
testdata Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
listenlist_test.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Makefile.am change from isc_nmhandle_ref/unref to isc_nmhandle attach/detach 2020-09-11 12:17:57 -07:00
notify_test.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
nstest.c Purge memory pool upon plugin destruction 2020-09-25 13:32:34 -07:00
nstest.h update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
plugin_test.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
query_test.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
wrap.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00