On Jan 3, 2008 1:11 PM, Pekka Pessi <[EMAIL PROTECTED]> wrote:
> 2008/1/3, Fabio Margarido <[EMAIL PROTECTED]>:
> > I ran configure with --enable-ndebug, but the funny thing is I didn't
> > see -DNDEBUG in the compilation commands anywhere. There's a detail in
> > my implementation that I a little suspicious about. I have a class
> > that represents a SIP call, and associated with each object of this
> > class is a su_home_t instance. I don't know if that's a bad design
> > decision, but if you feel that might be a problem, it could be
> > changed. The destructor of this class calls su_home_unref for the
> > object's instance of su_home_t. While I'm at it, the whole list of
> > sofia calls my destructor does is, in order:
> >
> > nua_handle_magic, to obtain my context associated to the call, and
> > then free on the pointer returned;
>
> And subsequent call to nua_handle_bind(nh, NULL)?
>
> > nua_handle_unref (it was nua_handle_destroy, but someone on the list
> > suggested I changed it);
>
> Please, use nua_handle_destroy(). You may get events after nua_handle_unref()
>
> > nua_destroy_event (for all the saved events I have on a list in each 
> > object);
> > su_home_deinit on the object's memory home.
>
> > Do you see any problem with this approach? I'm thinking of leaving the
> > su_home_t of each object pointing to NULL instead of using
> > su_home_init in the constructor and see where that goes.
>
> Unless you call nua_handle_destroy() you may get events from stack and
> if you do not call nua_handle_bind(nh, NULL) the stack keeps your
> stale pointer around and passes it to your callback in events...
>
> I send this to list, too..

Hi there,

the main problem with my application seems to be fixed now, it proved
to be concurrency corrupting the heap after all. Your tip about doing
'nua_handle_bind(nh, NULL)' was really helpful though, I wasn't doing
it and it definitely helped.
However there is still one issue causing me trouble. After I changed
back to nua_handle_detroy() from nua_handle_unref(), as you suggested,
I got a crash with a SIGABRT today, but the machine rebooted and I was
unable to fetch any further info about it. I suspect it is the same
issue I described in my other thread
(http://sourceforge.net/mailarchive/forum.php?thread_name=1715019e0712120241j71323d0bs6ae65bd9bd60166c%40mail.gmail.com&forum_name=sofia-sip-devel),
in which Mikhail Zabaluev suggested I used nua_handle_unref().
If I confirm this was indeed the same issue, what should I do? If I
understand correctly, the right way is to use nua_handle_destroy(),
but it has a known problem, is that it?
Thanks again.

Fabio Margarido

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to