[avahi] Multiple AvahiThreadedPolls in the same process

Joe Hasbani jsh at purestorage.com
Mon Mar 19 12:52:43 PDT 2012


Hi all,

Is it possible/safe to have multiple AvahiThreadedPolls running in the
same process?   (In an ideal world, I wouldn't be doing this, but I do
have my reasons.)

I ask because I am running into trouble.  In my program, each poll has
an associated client and service browser for the same service.
Everything looks to be functioning fine until I attempt to resolve a
service.  At that point, any number of crashes may be experienced.  If
I run with only one poll, I don't experience these crashes, and
resolutions complete successfully.  I am using no globals to track the
poll, client, or browser, so I don't anticipate conflict due to my
code.

I guess I am wondering if I have a bug in my code or if this simply
isn't expected to work.

Please find below some sample stack traces.

Thanks for your time,

Joe Hasbani
Pure Storage


Program received signal SIGSEGV, Segmentation fault.
#0  0x00007fffeeb64bfc in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#1  0x00007fffeeb64c69 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#2  0x00007fffeeb4bab3 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#3  0x00007fffeeb4d067 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#4  0x00007fffeeb4c634 in dbus_connection_send_with_reply_and_block ()
from /lib/x86_64-linux-gnu/libdbus-1.so.3
#5  0x00007fffeeb47836 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#6  0x00007fffeeb48f24 in dbus_bus_add_match () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#7  0x00007fffefa130be in avahi_client_new () from
/usr/lib/x86_64-linux-gnu/libavahi-client.so.3

Program received signal SIGSEGV, Segmentation fault.
#0  0x00007fffeeb65ce5 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#1  0x00007fffeeb51246 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#2  0x00007fffeeb55851 in dbus_message_get_reply_serial () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#3  0x00007fffeeb4972e in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#4  0x00007fffeeb61259 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#5  0x00007fffeeb61b75 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#6  0x00007fffeeb6248c in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#7  0x00007fffeeb60ee2 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#8  0x00007fffeeb4bc0c in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#9  0x00007fffeeb6311a in dbus_watch_handle () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#10 0x00007fffefc27638 in avahi_simple_poll_dispatch () from
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#11 0x00007fffefc2790d in avahi_simple_poll_loop () from
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#12 0x00007fffefc2798c in ?? () from
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#13 0x00007ffff0bb5d8c in start_thread (arg=0x7fffd15e2700) at
pthread_create.c:304
#14 0x00007fffef54b04d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#15 0x0000000000000000 in ?? ()


process 32126: arguments to dbus_message_get_reply_serial() were
incorrect, assertion "message != NULL" failed in file dbus-message.c
line 1028.
This is normally a bug in some application using the D-Bus library.
(gdb) bt
#0  0x00007fffeeb64c07 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#1  0x00007fffeeb64e09 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#2  0x00007fffeeb4c7f3 in dbus_connection_dispatch () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#3  0x00007fffefa1aad6 in ?? () from
/usr/lib/x86_64-linux-gnu/libavahi-client.so.3
#4  0x00007fffefc27620 in avahi_simple_poll_dispatch () from
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#5  0x00007fffefc2790d in avahi_simple_poll_loop () from
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#6  0x00007fffefc2798c in ?? () from
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3
#7  0x00007ffff0bb5d8c in start_thread (arg=0x7fffdbff7700) at
pthread_create.c:304
#8  0x00007fffef54b04d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffaf47d700 (LWP 32292)]
0x00007fffeeb5219f in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
(gdb) bt
#0  0x00007fffeeb5219f in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#1  0x00007fffeeb5384d in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#2  0x00007fffeeb53a08 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#3  0x00007fffeeb511de in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#4  0x00007fffeeb55055 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#5  0x00007fffeeb56eb1 in dbus_message_iter_append_basic () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#6  0x00007fffeeb5750b in dbus_message_append_args_valist () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#7  0x00007fffeeb57869 in dbus_message_append_args () from
/lib/x86_64-linux-gnu/libdbus-1.so.3
#8  0x00007fffefa18d93 in avahi_service_resolver_new () from
/usr/lib/x86_64-linux-gnu/libavahi-client.so.3


More information about the avahi mailing list