Fix: use newly created event filter for condition check
A message that is not in the archive (sent off-list or not yet received): [email protected]
Do not review, this include a change that should not be part of this commit.
Quoted 70 lines · Jonathan Rajotte
The following commit introduced a regression while fixing the filter and
filter_expressionownership.commit
b0a23296344e57bd2e48e62ec2d7e0d8a38661bbAuthor: Jérémie Galarneau <[email protected]> Date: Sat Jan 12 14:53:56 2019 -0500Fix: leak of filter bytecode and expression on agent event re-enable
The agent subsystem does not properly assume the clean-up of an event's filter bytecode and expression when a previously disabled event is re-enabled.
This change ensures that the ownership of both the filter bytecode and expression is assumed by the agent subsystem and discarded when a matching event is found.
Steps to reproduce the leak:
$ lttng create
$ lttng enable-event --python allo --filter 'a[42] == 241' $ lttng disable-event --python allo
$ lttng enable-event --python allo --filter 'a[42] == 241'Signed-off-by Jérémie Galarneau <[email protected]>Setting the "filter" object to NULL prevents the call to
add_filter_app_ctxwhen needed.We use the filter from the newly created event to perform the check and the call to
add_filter_app_ctx.Fixes coverity #1399733
Signed-off-by Jonathan Rajotte <[email protected]>--- src/bin/lttng-sessiond/agent.c | 1 + src/bin/lttng-sessiond/event.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)src/bin/lttng-sessiond/agent.c +1
-0@@ -1145,6 +1145,7 @@ struct agent_event *agent_create_event(const char *name, event->loglevel_type = loglevel_type; event->filter = filter; event->filter_expression = filter_expression; + event->enabled =0 ; error:return event; }src/bin/lttng-sessiond/event.c +3
-2@@ -513,8 +513,9 @@ int event_agent_enable(struct ltt_ust_session *usess, created =1 ; } -if (created && filter) { - ret =add_filter_app_ctx (filter, filter_expression, agt); +if (created && aevent->filter) { + ret =add_filter_app_ctx ( + aevent->filter, aevent->filter_expression, agt);if (ret !=LTTNG_OK ) { goto error; }Signature · 1 line
2.17.1
Signature · 2 lines
Jonathan Rajotte-Julien EfficiOS