Bug #10624
closedMemory leak in Unbound with Python module and DHCP lease registration active
100%
Description
Issue reported and diagnosed on forums here: Was able to see evidence of this on SG-1100 and SG-3100.
https://forum.netgate.com/topic/154113/sg-1100-2-4-5-unbound-python-module-dhcp-lease-dns-registration-memory-leak
TLDR: When an unbound python module is configured, and the "Register DHCP leases in the DNS resolver" option is enabled. DHCP clients joining the network cause unbound memory usage to increase each time.
If I disable either the python module, or the option to register leases, things appear to function normally.
Related issues
Updated by Jim Pingle over 4 years ago
- Subject changed from Unbound configuration memory leak to Unbound configuration memory leak with python module + register DHCP leases active
Updated by Jim Pingle almost 4 years ago
This would likely be fixed by also solving #5413 since it wouldn't restart in this case. Though the actual memory leak should be re-tested on unbound 1.13.1 and if it's still present, it should be reported upstream to the Unbound devs.
Updated by Jim Pingle almost 4 years ago
- Related to Bug #5413: Reduce disruptions when changing DNS records from DHCP leases in Unbound added
Updated by Christian McDonald almost 2 years ago
- Assignee set to Christian McDonald
Updated by Christian McDonald almost 2 years ago
- Status changed from New to Confirmed
This is confirmed.
Python3.9 and lower has some deeply rooted memory management problems. Because of the way Unbound reinitializes the Python context every time Unbound is reloaded via unbound-control
reload or kill -HUP
, some memory is leaked.
Moving to Python3.10+ greatly improves this situation.
Updated by Jim Pingle almost 2 years ago
- Related to Regression #11316: Unbound crashes with signal 11 when reloading added
Updated by Christian McDonald almost 2 years ago
https://github.com/NLnetLabs/unbound/pull/827
We also need Unbound to quit reloading the interpreter on every SIGHUP/reload. This is unnecessary.
Updated by Christian McDonald almost 2 years ago
- Target version set to 2.7.0
- Plus Target Version set to 23.01
- Release Notes set to Default
Updated by Christian McDonald almost 2 years ago
- Affected Architecture All added
- Affected Architecture deleted (
SG-1100, SG-3100)
Updated by Christian McDonald almost 2 years ago
- Status changed from Confirmed to Feedback
https://github.com/pfsense/FreeBSD-ports/commit/190a54b5581d5a20b5f839a8a01180d201883cab
This should be significantly improved.
Test the latest snapshots
Updated by Jim Pingle almost 2 years ago
- Subject changed from Unbound configuration memory leak with python module + register DHCP leases active to Memory leak in Unbound with Python module and DHCP lease registration active
- Start date deleted (
06/02/2020)
Updating subject for release notes.
Updated by Christian McDonald almost 2 years ago
Even more improvements were realized https://github.com/pfsense/FreeBSD-ports/commit/2585ff63a67594c3530a2bc111c5544ec2805bb9
Testing appreciated
Updated by Jim Pingle almost 2 years ago
- Status changed from Feedback to Resolved
- % Done changed from 0 to 100
No reports of problems that I've seen since the fix is in place. If it recurs we can always reopen or start a fresh issue as needed.