Hi Denis,

I tried several things but no luck. Here I am attaching the backtrace as you suggested. What I found is, ofono crashes on `ofono_gprs_context_remove(data->gc)` call when `linktop_disconnect` was called second time. I am still not sure why `linktop_disconnect` is being called twice in this case.

Regards
--
Amit Mendapara

On Thu, Feb 24, 2011 at 11:01 PM, Denis Kenzior <denkenz@gmail.com> wrote:
Hi Amit,

On 02/23/2011 11:07 PM, Amit Mendapara wrote:
> Hi,
>
> While testing the Linktop driver I observed that ofono is crashing if I
> try to set modem offline while it is connected (using
> test/offline-modem.py script). After some debugging, I found that
> `linktop_disconnect` function is being called twice (see the attached
> debug log).
>
> What could be the reason here? I have seen some hack in mbm driver (in
> mbm_disconnect) having `reopen_callback`. I have tried this but then
> having another crash (this time when creating gprs context). Anyone,
> please clarify how to deal with the issue properly?

Some of these modems HUP the tty for x seconds.  So if you try to open
them too fast, they will be HUPed again, leading to various issues.

When posting backtraces, please give them directly from gdb, or use the
backtrace script to 'prettify' them.  e.g.:

test/backtrace src/ofonod your_log

Regards,
-Denis