Bug#578019: libwebkit-1.0-2: makes DNS query for every mouse movement

ian_bruce at fastmail.net ian_bruce at fastmail.net
Mon Apr 19 11:21:35 UTC 2010


On Sun, 18 Apr 2010 10:08:23 -0400
Michael Gilbert <michael.s.gilbert at gmail.com> wrote:

> i suppose i am not able to reproduce it either.  i see a modest amount
> of dns queries when the page is first loaded, then more queries when
> links are moused over.

I have that too, the first time the mouse pointer touches a link to some
website. I think we can agree that this DNS pre-resolution is an
intentional feature. What I claim is a bug is this:

> but i don't see the claimed activity for every pixel moved by the
> mouse.

-- except, strangely enough, if the mouse pointer moves along a link
which has already been resolved once, no more DNS queries are
generated. As soon as it ceases to touch any hyperlink at all, there is
a continuous stream of DNS queries for every mouse movement event.

Some thoughts:

-- the domain name which is being queried seems to be literally "." (or
perhaps even the null string). Naturally, the response from the DNS
server is that this name cannot be resolved.

-- suppose that WebKit, for some obscure reason, fails to distinguish
between the cases that the mouse is hovering over a link with a hostname
of ".", and that the mouse is not over any link at all.

-- suppose further that WebKit fails to remember that "." is
unresolvable, and queries it again every time it thinks the mouse is
hovering over such a link.

-- then the above-mentioned DNS pre-resolution will result in exactly
the behavior that I've described, with the observed result that when the
mouse is over an actual hyperlink which has already been resolved, the
stream of DNS queries ceases.

Confirmation -- consider the following HTML page:

    <html>
    <head>
      <style>
      a:hover { color: #00FF00 }
      </style>
    </head>
    <body>
      <h1>It works!</h1>
      <p>This is the default web page for this server.</p>
      <p>The web server software is running
         but no content has been added, yet.</p>
      <p>
        <a href="">null link</a>
        <a href="page.html">page.html</a>
        <a href="http://./">http://./</a>
        <a href="http://./page.html">http://./page.html</a>
      </p>
    </body>
    </html>

When viewing this page (in Midori) as <http://127.0.0.1/index.html>,
mouse movement over the non-link area of the page produces the usual DNS
query storm. Movement over the first two links does not produce any DNS
queries. However, movement over the second two links produces EXACTLY
the same DNS storm as the non-link area.

Strangely, when the page is viewed as <file:///var/www/index.html>,
mouse movement over the hyperlinks or any other part of the page does
not result in the DNS query storm.

This still doesn't explain why you do not observe the same behavior.
Maybe it depends on what kind of error gethostbyname(3) returns for the
hostname "." .

If so, then it might have something to do with the contents of the files
/etc/{host.conf,resolv.conf,nsswitch.conf} .

Here's mine; maybe you can reproduce the problem by using these:

    $ cat /etc/host.conf 
    multi on
    order hosts,bind

    $ cat /etc/resolv.conf
    nameserver <NS1-IP-ADDR>
    nameserver <NS2-IP-ADDR>

    $ cat /etc/nsswitch.conf 
    passwd:         compat
    group:          compat
    shadow:         compat
    hosts:          files dns
    networks:       files
    protocols:      db files
    services:       db files
    ethers:         db files
    rpc:            db files
    netgroup:       nis






More information about the Pkg-webkit-maintainers mailing list