[avahi] Problems with avahi segfaulting when cleaning up resources
james.hodapp at gmail.com
Wed Oct 29 13:46:18 PDT 2008
I went ahead and made my own thread instead putting the
"avahi_simple_poll_loop(simple_poll);" call in the new thread's main
function. I still get the exact same results as when using the built
in thread in Avahi and the "avahi_threaded_poll_start(threaded_poll)"
call instead of the simple_poll. I'm not quite sure where to go from
here. It does seem to be a timing/race condition within Avahi as it
seems that the first several times I run my app linked against
avahi-core that it won't segfault or abort, then it starts to segfault
and abort whenever I press CNTRL+C on my keyboard to shutdown my app.
On Sun, Oct 26, 2008 at 10:41 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 24.10.08 13:45, Jim Hodapp (james.hodapp at gmail.com) wrote:
>> I am using Avahi version 0.6.14 and am trying to use it on an embedded
>> ARM11 processor. I am using the example avahi-core for publishing a
>> service, but modified it to use a threaded-poll instead of the simple
>> poll. So when trying to unpublish any services published with avahi
>> and freeing any resources that it used, Avahi seems to randomly
>> complete sometimes, sometimes abort (due to asserts not evaluating to
>> true) and sometimes segfault. I am not sure why this is happening,
>> perhaps I am not freeing things correctly.
>> Here is my unpublish function:
>> int unpublish_services()
>> int ret = 0;
> _stop() is should be called unlocked. It locks internally anyway and the
> mutex is not recursive.
>> if (server)
>> ret = -1;
>> if (threaded_poll)
>> ret = -1
>> return ret;
> Otherwise the logic looks about right to me. i.e. first, stop the
> poll, then free the server, then free the poll.
> Lennart Poettering Red Hat, Inc.
> lennart [at] poettering [dot] net ICQ# 11060553
> http://0pointer.net/lennart/ GnuPG 0x1A015CC4
> avahi mailing list
> avahi at lists.freedesktop.org
More information about the avahi