Bug 1279

Summary: Memory leak on reload when python module is enabled
Product: unbound Reporter: Maxim Ivanov <ivanov.maxim>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: minor CC: cathya, wouter
Priority: P5    
Version: 1.6.2   
Hardware: x86_64   
OS: Linux   

Description Maxim Ivanov 2017-06-12 18:48:12 CEST
When unbound runs with python module loaded, following shell command causes slow memory leak: 

```
while unbound-control reload; do : ; done
```

If `python` is removed from `module-config`, then memory stays stable on reloads.



Python module itself is nothing but stubs:
```
def init(id, cfg):
    return True


def deinit(id): return True


def inform_super(id, qstate, superqstate, qdata): return True


def operate(id, event, qstate, qdata):
    if (event == MODULE_EVENT_NEW) or (event == MODULE_EVENT_PASS):
        qstate.ext_state[id] = MODULE_WAIT_MODULE
        return True

    elif event == MODULE_EVENT_MODDONE:
        qstate.ext_state[id] = MODULE_FINISHED
        return True

    log_err("pythonmod: Unknown event")
    qstate.ext_state[id] = MODULE_ERROR
    return True
```
Comment 1 Wouter Wijngaards 2017-06-13 09:11:54 CEST
Hi Maxim,

Thank you for the report.  The python script file name string wasn't cleaned up.  Fixed this in the code repository.

Best regards, Wouter