Bug 1279 - Memory leak on reload when python module is enabled
Memory leak on reload when python module is enabled
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.6.2
x86_64 Linux
: P5 minor
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-12 18:48 CEST by Maxim Ivanov
Modified: 2017-06-13 09:11 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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