2010-10-14 15:13:47

by Lukasz Rymanowski

[permalink] [raw]
Subject: [PATCH] Unref pending call in fallback scenario.

Drop the reference to pending call in fallback scenario.
Otherwise, dbus will assert once timer expires.
---
src/agent.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/agent.c b/src/agent.c
index c7fdbd4..b65a550 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -706,6 +706,7 @@ static int request_fallback(struct agent_request *req,
return -EINVAL;

dbus_pending_call_cancel(req->call);
+ dbus_pending_call_unref(req->call);

msg = dbus_message_copy(req->msg);

--
1.6.3.3



2010-10-14 20:34:36

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Unref pending call in fallback scenario.

Hi Lukasz,

On Thu, Oct 14, 2010, Lukasz Rymanowski wrote:
> Drop the reference to pending call in fallback scenario.
> Otherwise, dbus will assert once timer expires.
> ---
> src/agent.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/agent.c b/src/agent.c
> index c7fdbd4..b65a550 100644
> --- a/src/agent.c
> +++ b/src/agent.c
> @@ -706,6 +706,7 @@ static int request_fallback(struct agent_request *req,
> return -EINVAL;
>
> dbus_pending_call_cancel(req->call);
> + dbus_pending_call_unref(req->call);
>
> msg = dbus_message_copy(req->msg);
>

Good catch. The patch has been pushed upstream. Over the last few years
I've bumped into this libdbus issue several times but it seems this
particular code path (request_fallback) gets triggered seldom enough for
it to not have surfaced earlier. I also vaguely remember that this got
fixed in newer D-Bus versions so those might not assert in this case
anymore.

Johan