bind9/lib
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
..
bind9 update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
dns rndc dumpdb -expired: print when RRsets expired 2020-09-23 16:09:26 +02:00
irs update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
isc It appears that you can't change what you are polling for while connecting. 2020-09-23 13:54:06 +10:00
isccc update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
isccfg Update library API versions 2020-09-16 22:34:06 +02:00
ns Purge memory pool upon plugin destruction 2020-09-25 13:32:34 -07:00
samples update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
win32/bindevt update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
.gitignore Provide unit test driver 2020-05-21 12:13:01 +02:00
Makefile.am Complete rewrite the BIND 9 build system 2020-04-21 14:19:48 +02:00
unit-test-driver.sh.in Provide unit test driver 2020-05-21 12:13:01 +02:00