This patch resolves a crash in the services agent when a requested action times out. The problem was that when the action timed out, the data associated with the action was freed, but the mainloop still had the stdout and stderr pipes registered for monitoring. This ensures that those get unregistered when the action data is being cleaned up.
Signed-off-by: Russell Bryant rbryant@redhat.com --- src/lib/services.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/lib/services.c b/src/lib/services.c index f199ed5..5768a5e 100644 --- a/src/lib/services.c +++ b/src/lib/services.c @@ -88,6 +88,16 @@ services_action_free(svc_action_t *op) return; }
+ if (op->opaque->stderr_gsource) { + mainloop_destroy_fd(op->opaque->stderr_gsource); + op->opaque->stderr_gsource = NULL; + } + + if (op->opaque->stdout_gsource) { + mainloop_destroy_fd(op->opaque->stdout_gsource); + op->opaque->stdout_gsource = NULL; + } + free(op->id); free(op->opaque->exec);
matahari@lists.fedorahosted.org