Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] gatchat: make sure to unsubscribe the GAtIO write handler on disconnect.
Date: Tue, 23 Nov 2010 03:22:43 -0600	[thread overview]
Message-ID: <4CEB87E3.8050708@gmail.com> (raw)
In-Reply-To: <1290400982-17615-2-git-send-email-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

Hi Andrew,

On 11/21/2010 10:43 PM, Andrzej Zaborowski wrote:
> There's a small probability that we call chat_wakeup_writer
> just before the channel disonnects and for some reason glib then
> calls can_write_data after we have unrefed the io and freed all the
> resources.  Calling at_chat_suspend unsubscribes can_write_data
> from the io.
> ---
>  gatchat/gatchat.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
> index 218f592..957181c 100644
> --- a/gatchat/gatchat.c
> +++ b/gatchat/gatchat.c
> @@ -40,6 +40,7 @@
>  
>  struct at_chat;
>  static void chat_wakeup_writer(struct at_chat *chat);
> +static void at_chat_suspend(struct at_chat *chat);

This is really against the coding standard ;)

>  
>  static const char *none_prefix[] = { NULL };
>  
> @@ -364,6 +365,7 @@ static void io_disconnect(gpointer user_data)
>  	struct at_chat *chat = user_data;
>  
>  	chat_cleanup(chat);
> +	at_chat_suspend(chat);
>  	g_at_io_unref(chat->io);
>  	chat->io = NULL;
>  

Actually I think the right fix is to remove the write watcher in
io_shutdown.

I pushed an experimental patch 99107c6c9d0ae42eb96621b0fc34972e418f1755,
please let me know if this fixes the issue.

Regards,
-Denis

  reply	other threads:[~2010-11-23  9:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22  4:43 [PATCH] stk: Handle null Text field Andrzej Zaborowski
2010-11-22  4:43 ` [PATCH] gatchat: make sure to unsubscribe the GAtIO write handler on disconnect Andrzej Zaborowski
2010-11-23  9:22   ` Denis Kenzior [this message]
2010-11-23 23:39     ` Andrzej Zaborowski
2010-11-23  9:09 ` [PATCH] stk: Handle null Text field Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CEB87E3.8050708@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox