GNOME Bugzilla – Bug 349776
Bad mDNS records not handled gracefully
Last modified: 2018-08-17 13:50:43 UTC
This bug was reported here: https://launchpad.net/distros/ubuntu/+source/epiphany-browser/+bug/52722 "With an up-to-date Dapper, Epiphany starts up, shows its window, then freezes for 10 to 15 seconds. During that time, window contents are not painted and I can see the desktop through the window frame. Dragging the window makes psychadelic patterns in it. After the delay, Epiphany works normally and is quite snappy. CPU usage during the delay is a little high, but not pegged. This started sometime last week on two machines. Firefox, in comparison, works fine." "I got to thinking that this is a network problem, since this is obviously not a widespread bug. I figured maybe epiphany was doing a network request that was taking a long time. Bingo! During the hang, `sudo netstat -a4p | grep epiphany` shows epiphany with an established UDP connection to the domain socket on my gateway, a linksys router. So, I fired up Ethereal and watched packets. A cursory analysis: o Hang seems to be originating from some Avahi/MDNS queries related to discovering 'Local Sites' bookmarks. o There turned out to be a (misconfigured) Avahi server on another machine on the LAN. It serves up some MDNS web site pointers for devices on the LAN that don't have the capability to do that for themselves. o Those devices had been removed from the LAN, but the rogue Avahi server was serving _http._tcp.local TXT records for them still. o epiphany on my machine gets the SRV records from MDNS, then queries MDNS for A records for the advertised services, which it never receives. It then tries to query the DNS service on the router to find the records, which fails. This happens a few times. Finally it stops trying and the hang ends. o ephy starts up. The dummy, invalid 'Local Sites' appear in the menu. Selecting one of them sends ephy into the same query fits, but does not hang the UI, and the request eventually times out normally. I'm not familiar with the code, but a simple fix would seem to be making epiphany avoid querying for A records from MDNS until the user actually clicks one of the Local Sites bookmarks. I can't imagine spurious SRV are all that rare, be nice if this kind of thing were handled more gracefully. Sorry this took so long to figure out."
Epiphany uses the async gnome-vfs functions for this, which shouldn't ever block our UI. So this is either a gnome-vfs problem or an avahi problem.
gnome-vfs got deprecated in 2008. gnome-vfs is not under active development anymore and had its last code changes in 2011. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-vfs/commits/master gio (in glib) and gvfs are its successors. See https://developer.gnome.org/gio/stable/ch33.html and https://people.gnome.org/~gicmo/gio-migration-guide/ for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of glib/gio/gvfs. Thanks!