After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 629345 - gvfsd-dav crash in __strcmp_ia32() from avahi_service_resolver_event()
gvfsd-dav crash in __strcmp_ia32() from avahi_service_resolver_event()
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: webdav backend
1.6.x
Other Linux
: Normal critical
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2010-09-11 09:22 UTC by Milan Bouchet-Valat
Modified: 2015-03-15 11:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
dnssd: Prevent crash when resolving service (4.48 KB, patch)
2015-03-08 00:57 UTC, Ross Lagerwall
committed Details | Review
dnssd: Remove recursive main loop (2.87 KB, patch)
2015-03-08 00:57 UTC, Ross Lagerwall
committed Details | Review
dnssd: Run GSimpleAsyncResult completion in idle (2.40 KB, patch)
2015-03-08 00:57 UTC, Ross Lagerwall
committed Details | Review

Description Milan Bouchet-Valat 2010-09-11 09:22:11 UTC
I tried mounting a WebDAV share exported via gnome-user-share from another Lucid computer. I got a "no reply" error, and then the crash dialog.

gvfs-backends 1.6.1 on Ubuntu 10.04.


  • #0 __strcmp_ia32
    from /lib/tls/i686/cmov/libc.so.6
  • #1 avahi_service_resolver_event
    at resolver.c line 58
  • #2 filter_func
    at client.c line 256
  • #3 dbus_connection_dispatch
    at dbus-connection.c line 4444
  • #4 dispatch_timeout_callback
    at ../avahi-common/dbus-watch-glue.c line 107
  • #5 dispatch_func
    at glib-watch.c line 254
  • #6 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.24.1/glib/gmain.c line 1960
  • #7 g_main_context_iterate
    at /build/buildd/glib2.0-2.24.1/glib/gmain.c line 2591
  • #8 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.24.1/glib/gmain.c line 2799
  • #9 daemon_main
    at daemon-main.c line 294
  • #10 main
    at daemon-main-generic.c line 39

Comment 1 stoneguy3 2012-02-17 20:08:46 UTC
Confirmed by https://bugs.launchpad.net/bugs/932449
Comment 2 Felix Möller 2012-07-30 00:00:59 UTC
This is still valid with gvfs 1.12.1 on Ubuntu 12.04
Comment 3 Felix Möller 2012-07-30 00:17:02 UTC
The backtrace is:

Stacktrace:
 #0  __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:213
 No locals.
 #1  0x00007fea208f4664 in avahi_service_resolver_event (client=<optimized out>, event=AVAHI_RESOLVER_FOUND, message=0x7fea10009610) at resolver.c:56
         r = 0x7fea10009f70
         error = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 0, dummy3 = 0, dummy4 = 0, dummy5 = 0, padding1 = 0x6600000000}
         path = 0x7fea1000a048 "/Client34/ServiceResolver1"
         strlst = 0x0
         __PRETTY_FUNCTION__ = "avahi_service_resolver_event"
 #2  0x00007fea208f02c5 in filter_func (bus=<optimized out>, message=0x7fea10009610, userdata=0x7fea100068d0) at client.c:256
         client = 0x7fea100068d0
         error = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 0, dummy3 = 0, dummy4 = 0, dummy5 = 1, padding1 = 0x7fff1de27410}
         __PRETTY_FUNCTION__ = "filter_func"
 #3  0x00007fea2423e9a6 in dbus_connection_dispatch () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 No symbol table info available.
 #4  0x00007fea208f6dd6 in dispatch_timeout_callback (t=<optimized out>, userdata=<optimized out>) at ../avahi-common/dbus-watch-glue.c:105
         d = 0x7fea10006c10
 #5  0x00007fea20d09603 in start_timeout_callback (t=0x7fea100069d0) at glib-watch.c:252
 No locals.
 #6  dispatch_func (source=0x7fea10006800, callback=<optimized out>, userdata=<optimized out>) at glib-watch.c:331
         now = {tv_sec = 1343607155, tv_usec = 769995}
         tvnow = {tv_sec = 1343607155, tv_usec = 769995}
         g = 0x7fea10006800
         w = <optimized out>
         next_timeout = 0x7fea100069d0
         __PRETTY_FUNCTION__ = "dispatch_func"
 #7  0x00007fea23135d53 in g_main_dispatch (context=0x239b990) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:2539
         dispatch = 0x7fea20d09540 <dispatch_func>
         was_in_call = 0
         user_data = 0x0
         callback = 0
         cb_funcs = 0x0
         cb_data = 0x0
         current_source_link = {data = 0x7fea10006800, next = 0x0}
         need_destroy = <optimized out>
         source = 0x7fea10006800
         current = 0x2392920
         i = <optimized out>
 #8  g_main_context_dispatch (context=0x239b990) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3075
 No locals.
 #9  0x00007fea231360a0 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x239b990, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3146
         timeout = 0
         some_ready = 1
         fds = <optimized out>
         max_priority = 0
         nfds = 3
         allocated_nfds = <optimized out>
 #10 g_main_context_iterate (context=0x239b990, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3083
         some_ready = 1
 #11 0x00007fea2313649a in g_main_loop_run (loop=0x23911a0) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3340
         __PRETTY_FUNCTION__ = "g_main_loop_run"
 #12 0x00000000004114d0 in daemon_main (argc=4, argv=<optimized out>, max_job_threads=1, default_type=0x422caf "dav", mountable_name=<optimized out>, first_type_name=0x422caf "dav") at daemon-main.c:300
         var_args = {{gp_offset = 48, fp_offset = 0, overflow_arg_area = 0x7fff1de27680, reg_save_area = 0x7fff1de275e0}}
         connection = <optimized out>
         loop = <optimized out>
         daemon = 0x238e5e0
         derror = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 0, dummy3 = 1, dummy4 = 1, dummy5 = 1, padding1 = 0x7fea2314f31c}
         mount_spec = 0x0
         mount_source = <optimized out>
         error = 0x0
         res = <optimized out>
         type = <optimized out>
 #13 0x0000000000409c10 in main (argc=4, argv=0x7fff1de27778) at daemon-main-generic.c:39
 No locals.
StacktraceAddressSignature: /usr/lib/gvfs/gvfsd-dav:11:x86_64:/usr/lib/x86_64-linux-gnu/libavahi-client.so.3.2.9+9664:/usr/lib/x86_64-linux-gnu/libavahi-client.so.3.2.9+52c5:/lib/x86_64-linux-gnu/libdbus-1.so.3.5.8+e9a6:/usr/lib/x86_64-linux-gnu/libavahi-client.so.3.2.9+bdd6:/usr/lib/x86_64-linux-gnu/libavahi-glib.so.1.0.2+1603:/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3+47d53:/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3+480a0:/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3+4849a:/usr/lib/gvfs/gvfsd-dav+114d0:/usr/lib/gvfs/gvfsd-dav+9c10
StacktraceTop:
 avahi_service_resolver_event (client=<optimized out>, event=AVAHI_RESOLVER_FOUND, message=0x7fea10009610) at resolver.c:56
 filter_func (bus=<optimized out>, message=0x7fea10009610, userdata=0x7fea100068d0) at client.c:256
 dbus_connection_dispatch () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 dispatch_timeout_callback (t=<optimized out>, userdata=<optimized out>) at ../avahi-common/dbus-watch-glue.c:105
 start_timeout_callback (t=0x7fea100069d0) at glib-watch.c:252
Tags:  precise running-unity
ThreadStacktrace:
 .
 Thread 4 (Thread 0x7fea1dcd5700 (LWP 7931)):
 #0  0x00007fea2402233d in sendmsg () at ../sysdeps/unix/syscall-template.S:82
 No locals.
 #1  0x00007fea236a3ac6 in g_socket_send_message (socket=0x7fea18005280, address=0x0, vectors=0x7fea1dcd4c70, num_vectors=<optimized out>, messages=<optimized out>, num_messages=<optimized out>, flags=0, cancellable=0x7fea18002290, error=0x7fea1dcd4c88) at /build/buildd/glib2.0-2.32.3/./gio/gsocket.c:3783
         msg = {msg_name = 0x0, msg_namelen = 0, msg_iov = 0x7fea1dcd4c70, msg_iovlen = 1, msg_control = 0x0, msg_controllen = 0, msg_flags = 0}
         result = <optimized out>
         one_vector = {buffer = 0x7fea18010ac0, size = 140643593604016}
         zero = 0 '\000'
         __PRETTY_FUNCTION__ = "g_socket_send_message"
 #2  0x00007fea236fc966 in write_message_continue_writing (data=0x7fea18010ac0) at /build/buildd/glib2.0-2.32.3/./gio/gdbusprivate.c:1034
         vector = {buffer = 0x7fea180108e0, size = 128}
         control_message = 0x0
         bytes_written = <optimized out>
         error = 0x0
         ostream = 0x7fea18005490
         simple = 0x7fea140030a0
         fd_list = 0x0
         __PRETTY_FUNCTION__ = "write_message_continue_writing"
 #3  0x00007fea236fce57 in continue_writing (worker=0x7fea1800dcb0) at /build/buildd/glib2.0-2.32.3/./gio/gdbusprivate.c:1529
         old_message = 0x7fea1800bb20
         new_blob = <optimized out>
         new_blob_size = 1
         error = 0x7fea1800e800
         data = 0x7fea18010ac0
         flush_async_data = 0x0
         __PRETTY_FUNCTION__ = "continue_writing"
 #4  0x00007fea236fcf05 in continue_writing_in_idle_cb (user_data=<optimized out>) at /build/buildd/glib2.0-2.32.3/./gio/gdbusprivate.c:1550
         worker = <optimized out>
 #5  0x00007fea23135d53 in g_main_dispatch (context=0x7fea1800e4f0) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:2539
         dispatch = 0x7fea23133a20 <g_idle_dispatch>
         was_in_call = 0
         user_data = 0x7fea1800dcb0
         callback = 0x7fea236fcef0 <continue_writing_in_idle_cb>
         cb_funcs = 0x7fea233e19a0
         cb_data = 0x7fea180109d0
         current_source_link = {data = 0x7fea18010b00, next = 0x0}
         need_destroy = <optimized out>
         source = 0x7fea18010b00
         current = 0x7fea1800f980
         i = <optimized out>
 #6  g_main_context_dispatch (context=0x7fea1800e4f0) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3075
 No locals.
 #7  0x00007fea231360a0 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x7fea1800e4f0, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3146
         timeout = 0
         some_ready = 1
         fds = <optimized out>
         max_priority = 0
         nfds = 1
         allocated_nfds = <optimized out>
 #8  g_main_context_iterate (context=0x7fea1800e4f0, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3083
         some_ready = 1
 #9  0x00007fea2313649a in g_main_loop_run (loop=0x7fea1800e4a0) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3340
         __PRETTY_FUNCTION__ = "g_main_loop_run"
 #10 0x00007fea236fb406 in gdbus_shared_thread_func (user_data=<optimized out>) at /build/buildd/glib2.0-2.32.3/./gio/gdbusprivate.c:277
         data = 0x7fea1800e4c0
 #11 0x00007fea231579e5 in g_thread_proxy (data=0x7fea1800ba80) at /build/buildd/glib2.0-2.32.3/./glib/gthread.c:801
         thread = 0x7fea1800ba80
 #12 0x00007fea2401ae9a in start_thread (arg=0x7fea1dcd5700) at pthread_create.c:308
         __res = <optimized out>
         pd = 0x7fea1dcd5700
         now = <optimized out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -2641285313686219080, 140643515853488, 140643499071936, 0, 3, 2633619085403281080, 2633494188834346680}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
         not_first_call = 0
         pagesize_m1 = <optimized out>
         sp = <optimized out>
         freesize = <optimized out>
         __PRETTY_FUNCTION__ = "start_thread"
 #13 0x00007fea228c04bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
 No locals.
 #14 0x0000000000000000 in ?? ()
 No symbol table info available.
 .
 Thread 3 (Thread 0x7fea1e4d6700 (LWP 7930)):
 #0  __lll_unlock_wake () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:368
 No locals.
 #1  0x00007fea2401e104 in _L_unlock_644 () from /lib/x86_64-linux-gnu/libpthread.so.0
 No symbol table info available.
 #2  0x00007fea2401e063 in __pthread_mutex_unlock_usercnt (mutex=<optimized out>, decr=<optimized out>) at pthread_mutex_unlock.c:52
         type = 1
 #3  __pthread_mutex_unlock (mutex=0x7fea100071a0) at pthread_mutex_unlock.c:290
 No locals.
 #4  0x00007fea2423cd6a in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 No symbol table info available.
 #5  0x00007fea2423e309 in dbus_connection_send_with_reply () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 No symbol table info available.
 #6  0x00007fea2423e509 in dbus_connection_send_with_reply_and_block () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 No symbol table info available.
 #7  0x00007fea208f4f21 in avahi_service_resolver_new (client=0x7fea100068d0, interface=-1, protocol=-1, name=0x7fea10002330 "Öffentliche Dateien von fm auf thinkpad", type=0x7fea10002370 "_webdav._tcp", domain=0x7fea100023b0 "local", aprotocol=-1, flags=0, callback=0x7fea22b8f650 <service_resolver_cb>, userdata=0x7fea10001830) at resolver.c:271
         error = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 1, dummy3 = 1, dummy4 = 0, dummy5 = 0, padding1 = 0x7fea246a0235}
         r = <optimized out>
         message = 0x23959a0
         reply = 0x0
         i_interface = -1
         i_protocol = -1
         i_aprotocol = -1
         u_flags = 0
         path = <optimized out>
         __PRETTY_FUNCTION__ = "avahi_service_resolver_new"
 #8  0x00007fea22b8e506 in ensure_avahi_resolver (resolver=0x7fea10001830, error=0x0) at gvfsdnssdresolver.c:240
         avahi_client = 0x7fea100068d0
         ret = <optimized out>
 #9  0x00007fea22b8ed7a in ensure_avahi_resolver (error=0x0, resolver=0x7fea10001830) at gvfsdnssdresolver.c:230
         ret = 0
 #10 g_vfs_dns_sd_resolver_constructed (object=0x7fea10001830) at gvfsdnssdresolver.c:472
         resolver = 0x7fea10001830
 #11 0x00007fea233f9b83 in g_object_newv (object_type=<optimized out>, n_parameters=268459744, parameters=<optimized out>) at /build/buildd/glib2.0-2.32.3/./gobject/gobject.c:1741
         cparams = <optimized out>
         oparams = 0x7fea10005e40
         nqueue = <optimized out>
         object = 0x7fea10001830
         class = 0x7fea10001120
         unref_class = 0x0
         slist = <optimized out>
         n_total_cparams = <optimized out>
         n_cparams = <optimized out>
         n_oparams = 0
         n_cvalues = <optimized out>
         cvalues = <optimized out>
         clist = <optimized out>
         newly_constructed = 1
         i = <optimized out>
         __PRETTY_FUNCTION__ = "g_object_newv"
 #12 0x00007fea233f9ec6 in g_object_new_valist (object_type=140643267515136, first_property_name=<optimized out>, var_args=0x7fea1e4d5bd8) at /build/buildd/glib2.0-2.32.3/./gobject/gobject.c:1830
         class = 0x7fea10001120
         params = 0x7fea10005c30
         name = <optimized out>
         object = <optimized out>
         n_params = <optimized out>
         n_alloced_params = <optimized out>
         __PRETTY_FUNCTION__ = "g_object_new_valist"
 #13 0x00007fea233fa1d4 in g_object_new (object_type=140643267515136, first_property_name=0x7fea22b8ff86 "encoded-triple") at /build/buildd/glib2.0-2.32.3/./gobject/gobject.c:1545
         object = <optimized out>
         var_args = {{gp_offset = 48, fp_offset = 48, overflow_arg_area = 0x7fea1e4d5cc0, reg_save_area = 0x7fea1e4d5bf0}}
         __PRETTY_FUNCTION__ = "g_object_new"
 #14 0x00007fea22b8fa17 in g_vfs_dns_sd_resolver_new_for_encoded_triple (encoded_triple=0x2395a90 "Öffentliche Dateien von fm auf thinkpad._webdav._tcp.local", required_txt_keys=0x424495 "u") at gvfsdnssdresolver.c:799
         __PRETTY_FUNCTION__ = "g_vfs_dns_sd_resolver_new_for_encoded_triple"
 #15 0x0000000000410756 in do_mount (backend=0x23a0040, job=0x23b5080, mount_spec=0x239d4f0, mount_source=0x239af20, is_automount=<optimized out>) at gvfsbackenddav.c:1778
         error = <optimized out>
         dav_backend = 0x23a0040
         data = <optimized out>
         session = <optimized out>
         msg_opts = <optimized out>
         msg_stat = <optimized out>
         mount_base = <optimized out>
         signal_id = <optimized out>
         status = <optimized out>
         is_success = <optimized out>
         is_webdav = <optimized out>
         res = 1
         last_good_path = <optimized out>
         host = 0x2395a90 "Öffentliche Dateien von fm auf thinkpad._webdav._tcp.local"
         type = <optimized out>
 #16 0x0000000000416192 in g_vfs_job_run (job=0x23b5080) at gvfsjob.c:198
         class = 0x23a1c90
 #17 0x0000000000411acf in job_handler_callback (data=<optimized out>, user_data=<optimized out>) at gvfsdaemon.c:144
         job = 0x23b5080
 #18 0x00007fea23158248 in g_thread_pool_thread_proxy (data=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gthreadpool.c:309
         task = 0x23b5080
         pool = 0x2391300
 #19 0x00007fea231579e5 in g_thread_proxy (data=0x23b3590) at /build/buildd/glib2.0-2.32.3/./glib/gthread.c:801
         thread = 0x23b3590
 #20 0x00007fea2401ae9a in start_thread (arg=0x7fea1e4d6700) at pthread_create.c:308
         __res = <optimized out>
         pd = 0x7fea1e4d6700
         now = <optimized out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -2641285313686219080, 140733694767360, 140643507464640, 0, 3, 2633613588382013112, 2633494188834346680}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
         not_first_call = 0
         pagesize_m1 = <optimized out>
         sp = <optimized out>
         freesize = <optimized out>
         __PRETTY_FUNCTION__ = "start_thread"
 #21 0x00007fea228c04bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
 No locals.
 #22 0x0000000000000000 in ?? ()
 No symbol table info available.
 .
 Thread 2 (Thread 0x7fea1ecd7700 (LWP 7929)):
 #0  0x00007fea228b4b03 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
         resultvar = <optimized out>
         oldtype = 0
         result = <optimized out>
 #1  0x00007fea23136036 in g_main_context_poll (n_fds=1, fds=0x7fea180108a0, timeout=25000, context=0x7fea1800ebb0, priority=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3440
         poll_func = 0x7fea23142f40 <g_poll>
 #2  g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x7fea1800ebb0, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3141
         timeout = 25000
         some_ready = <optimized out>
         fds = 0x7fea180108a0
         max_priority = 2147483647
         nfds = 1
         allocated_nfds = <optimized out>
 #3  g_main_context_iterate (context=0x7fea1800ebb0, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3083
         some_ready = 402720928
 #4  0x00007fea2313649a in g_main_loop_run (loop=0x7fea1800ec70) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3340
         __PRETTY_FUNCTION__ = "g_main_loop_run"
 #5  0x00007fea236ed9cd in g_dbus_connection_send_message_with_reply_sync (connection=0x23a05e0, message=0x7fea1800bb20, flags=2147483648, timeout_msec=-1, out_serial=0x0, cancellable=0x0, error=0x7fea1ecd6b38) at /build/buildd/glib2.0-2.32.3/./gio/gdbusconnection.c:2191
         data = 0x7fea1800eb90
         reply = <optimized out>
         __PRETTY_FUNCTION__ = "g_dbus_connection_send_message_with_reply_sync"
 #6  0x00007fea236eddd0 in g_dbus_connection_call_sync_internal (connection=0x23a05e0, bus_name=0x7fea237369a9 "org.freedesktop.DBus", object_path=0x7fea237369be "/org/freedesktop/DBus", interface_name=0x7fea237369a9 "org.freedesktop.DBus", method_name=0x7fea2373e480 "Hello", parameters=0x0, reply_type=0x7fea2373692d, flags=2147483648, timeout_msec=-1, fd_list=0x0, out_fd_list=0x0, cancellable=0x0, error=0x23a0648) at /build/buildd/glib2.0-2.32.3/./gio/gdbusconnection.c:5514
         message = 0x7fea1800bb20
         reply = 0x0
         result = 0x0
         local_error = 0x0
         send_flags = <optimized out>
         __PRETTY_FUNCTION__ = "g_dbus_connection_call_sync_internal"
 #7  0x00007fea236efb68 in g_dbus_connection_call_sync (connection=<optimized out>, bus_name=<optimized out>, object_path=<optimized out>, interface_name=<optimized out>, method_name=<optimized out>, parameters=<optimized out>, reply_type=0x7fea2373692d, flags=2147483648, timeout_msec=-1, cancellable=0x0, error=0x23a0648) at /build/buildd/glib2.0-2.32.3/./gio/gdbusconnection.c:5739
 No locals.
 #8  0x00007fea236efe16 in initable_init (initable=0x23a05e0, cancellable=<optimized out>, error=0x7fea1ecd6c88) at /build/buildd/glib2.0-2.32.3/./gio/gdbusconnection.c:2613
         hello_result = <optimized out>
         connection = 0x23a05e0
         ret = 0
         __PRETTY_FUNCTION__ = "initable_init"
 #9  0x00007fea236f04d1 in g_bus_get_sync (bus_type=<optimized out>, cancellable=0x0, error=0x7fea1ecd6c88) at /build/buildd/glib2.0-2.32.3/./gio/gdbusconnection.c:6811
         connection = 0x23a05e0
         __PRETTY_FUNCTION__ = "g_bus_get_sync"
 #10 0x00007fea1fa47caa in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
 No symbol table info available.
 #11 0x00007fea1fa48087 in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
 No symbol table info available.
 #12 0x00007fea23135d53 in g_main_dispatch (context=0x23b7630) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:2539
         dispatch = 0x7fea23133a20 <g_idle_dispatch>
         was_in_call = 0
         user_data = 0x239c320
         callback = 0x7fea1fa48050
         cb_funcs = 0x7fea233e19a0
         cb_data = 0x23b4b70
         current_source_link = {data = 0x23b4b00, next = 0x0}
         need_destroy = <optimized out>
         source = 0x23b4b00
         current = 0x23b07b0
         i = <optimized out>
 #13 g_main_context_dispatch (context=0x23b7630) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3075
 No locals.
 #14 0x00007fea231360a0 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x23b7630, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3146
         timeout = 0
         some_ready = 1
         fds = <optimized out>
         max_priority = 0
         nfds = 1
         allocated_nfds = <optimized out>
 #15 g_main_context_iterate (context=0x23b7630, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3083
         some_ready = 1
 #16 0x00007fea2313649a in g_main_loop_run (loop=0x7fea180010c0) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3340
         __PRETTY_FUNCTION__ = "g_main_loop_run"
 #17 0x00007fea1fa4798b in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
 No symbol table info available.
 #18 0x00007fea231579e5 in g_thread_proxy (data=0x239ef70) at /build/buildd/glib2.0-2.32.3/./glib/gthread.c:801
         thread = 0x239ef70
 #19 0x00007fea2401ae9a in start_thread (arg=0x7fea1ecd7700) at pthread_create.c:308
         __res = <optimized out>
         pd = 0x7fea1ecd7700
         now = <optimized out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -2641285313686219080, 140733694764144, 140643515857344, 0, 3, 2633612487259772600, 2633494188834346680}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
         not_first_call = 0
         pagesize_m1 = <optimized out>
         sp = <optimized out>
         freesize = <optimized out>
         __PRETTY_FUNCTION__ = "start_thread"
 #20 0x00007fea228c04bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
 No locals.
 #21 0x0000000000000000 in ?? ()
 No symbol table info available.
 .
 Thread 1 (Thread 0x7fea2487c7c0 (LWP 7928)):
 #0  __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:213
 No locals.
 #1  0x00007fea208f4664 in avahi_service_resolver_event (client=<optimized out>, event=AVAHI_RESOLVER_FOUND, message=0x7fea10009610) at resolver.c:56
         r = 0x7fea10009f70
         error = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 0, dummy3 = 0, dummy4 = 0, dummy5 = 0, padding1 = 0x6600000000}
         path = 0x7fea1000a048 "/Client34/ServiceResolver1"
         strlst = 0x0
         __PRETTY_FUNCTION__ = "avahi_service_resolver_event"
 #2  0x00007fea208f02c5 in filter_func (bus=<optimized out>, message=0x7fea10009610, userdata=0x7fea100068d0) at client.c:256
         client = 0x7fea100068d0
         error = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 0, dummy3 = 0, dummy4 = 0, dummy5 = 1, padding1 = 0x7fff1de27410}
         __PRETTY_FUNCTION__ = "filter_func"
 #3  0x00007fea2423e9a6 in dbus_connection_dispatch () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 No symbol table info available.
 #4  0x00007fea208f6dd6 in dispatch_timeout_callback (t=<optimized out>, userdata=<optimized out>) at ../avahi-common/dbus-watch-glue.c:105
         d = 0x7fea10006c10
 #5  0x00007fea20d09603 in start_timeout_callback (t=0x7fea100069d0) at glib-watch.c:252
 No locals.
 #6  dispatch_func (source=0x7fea10006800, callback=<optimized out>, userdata=<optimized out>) at glib-watch.c:331
         now = {tv_sec = 1343607155, tv_usec = 769995}
         tvnow = {tv_sec = 1343607155, tv_usec = 769995}
         g = 0x7fea10006800
         w = <optimized out>
         next_timeout = 0x7fea100069d0
         __PRETTY_FUNCTION__ = "dispatch_func"
 #7  0x00007fea23135d53 in g_main_dispatch (context=0x239b990) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:2539
         dispatch = 0x7fea20d09540 <dispatch_func>
         was_in_call = 0
         user_data = 0x0
         callback = 0
         cb_funcs = 0x0
         cb_data = 0x0
         current_source_link = {data = 0x7fea10006800, next = 0x0}
         need_destroy = <optimized out>
         source = 0x7fea10006800
         current = 0x2392920
         i = <optimized out>
 #8  g_main_context_dispatch (context=0x239b990) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3075
 No locals.
 #9  0x00007fea231360a0 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x239b990, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3146
         timeout = 0
         some_ready = 1
         fds = <optimized out>
         max_priority = 0
         nfds = 3
         allocated_nfds = <optimized out>
 #10 g_main_context_iterate (context=0x239b990, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3083
         some_ready = 1
 #11 0x00007fea2313649a in g_main_loop_run (loop=0x23911a0) at /build/buildd/glib2.0-2.32.3/./glib/gmain.c:3340
         __PRETTY_FUNCTION__ = "g_main_loop_run"
 #12 0x00000000004114d0 in daemon_main (argc=4, argv=<optimized out>, max_job_threads=1, default_type=0x422caf "dav", mountable_name=<optimized out>, first_type_name=0x422caf "dav") at daemon-main.c:300
         var_args = {{gp_offset = 48, fp_offset = 0, overflow_arg_area = 0x7fff1de27680, reg_save_area = 0x7fff1de275e0}}
         connection = <optimized out>
         loop = <optimized out>
         daemon = 0x238e5e0
         derror = {name = 0x0, message = 0x0, dummy1 = 1, dummy2 = 0, dummy3 = 1, dummy4 = 1, dummy5 = 1, padding1 = 0x7fea2314f31c}
         mount_spec = 0x0
         mount_source = <optimized out>
         error = 0x0
         res = <optimized out>
         type = <optimized out>
 #13 0x0000000000409c10 in main (argc=4, argv=0x7fff1de27778) at daemon-main-generic.c:39
 No locals.
Comment 4 Ross Lagerwall 2015-03-08 00:57:00 UTC
Created attachment 298790 [details] [review]
dnssd: Prevent crash when resolving service

AvahiClient appears to require that avahi_service_resolver_new is
invoked from the same thread to which its poll function is bound
otherwise it can crash with a callback running while
avahi_service_resolver_new is still busy.

To fix this, always run avahi_service_resolver_new from the main loop.
To simplify the code, any errors from the function are ignored for now.

This crash could be reproduced 100% of the time by trying to mount
dav+sd (via gnome-user-share) in a single-CPU VM.
Comment 5 Ross Lagerwall 2015-03-08 00:57:11 UTC
Created attachment 298791 [details] [review]
dnssd: Remove recursive main loop

Don't run a recursive main loop on a separate thread with a shared
GMainContext.
Comment 6 Ross Lagerwall 2015-03-08 00:57:16 UTC
Created attachment 298792 [details] [review]
dnssd: Run GSimpleAsyncResult completion in idle

g_simple_async_result_complete should only be used from the thread on
which the callback should be invoked.  Also, the gvfs job threads do not
have their own GMainContexts which causes an assertion failure [1] when
invoking g_simple_async_result_complete.  Instead, use
g_simple_async_result_complete_in_idle().

[1] (process:11772): GLib-CRITICAL **: g_main_context_push_thread_default: assertion 'acquired_context' failed
Comment 7 Ondrej Holy 2015-03-13 15:20:50 UTC
Review of attachment 298790 [details] [review]:

Don't know this code well, but looks good to me and also fixes the problem you mentioned, so would be good to push it...

::: common/gvfsdnssdresolver.c
@@ -1202,3 @@
-      g_error_free (error);
-      goto out;
-    }

I hope this can't cause some crash later...
Comment 8 Ondrej Holy 2015-03-13 15:21:53 UTC
Review of attachment 298792 [details] [review]:

Looks good!
Comment 9 Ondrej Holy 2015-03-13 16:03:39 UTC
Review of attachment 298791 [details] [review]:

Looks good, just didn't you miss g_mutex_clear and g_cond_clear?
Comment 10 Ross Lagerwall 2015-03-14 15:13:32 UTC
Review of attachment 298790 [details] [review]:

::: common/gvfsdnssdresolver.c
@@ -1202,3 @@
-      g_error_free (error);
-      goto out;
-    }

It shouldn't because if there is an error, then no signal will be emitted and it will wait until service_resolver_timed_out is called.
Comment 11 Ross Lagerwall 2015-03-14 15:14:05 UTC
Review of attachment 298791 [details] [review]:

Ah, yes, I will fix that.
Comment 12 Ross Lagerwall 2015-03-14 15:20:27 UTC
Pushed all to master as a4c4ae6006cecc2bfe1519a669d4e15ff856e82f. Thanks for the review!