IPv6 support in nsprpub leads to inconvenient pauses

Steven Schwarz schwarz1 at cox.net
Wed May 26 16:38:31 PDT 2004


Hi, all,

I first noticed the following problem after upgrading from the mozilla
version on the 5.1-RELEASE: Sometimes when browsing a page mozilla
would pause for a very long period of time. On these occasions the
status message would indicate that mozilla was doing a DNS lookup.
But this wasn't a simple DNS mis-configuration issue, since an
independent nslookup of the same DNS lookup would complete immediately
(and successfully). Clearly something else was going on.

One hostname that sticks in my mind that I would invariably see
trigger the problem is the (much-hated) data.coremetrics.com. Having
a specific hostname was invaluable to tracking down what was going
on. Other hostnames (that I don't remember as precisely) had to do
with web advertising schemes.

Eventually I determined that the problem is that mozilla was trying to
do an IPv6 lookup (using getaddrinfo with a hints->ai_family ==
PF_UNSPEC [see getaddrinfo(3)]) and the lookup was failing, but only
after the annoyingly long timeout.

I looked in the freebsd-mozilla mail list archive and found a thread
titled "mozilla locking up" back in the July 2003 time frame that
appears likely to be about the same problem I was having. On that
thread, I found this advice from Joe Clarke:

        Two things.  First, if you're not using IPv6, and you have
        INET6 compiled into your kernel, remove it, and rebuild your
        kernel. Second, go to Preferences->Adavnced->Keyboard
        Navigation, and disable Find Automatically when typing into a
        webpage. 

I thought this issue deserved a more detailed writeup that would get
archived to the freebsd-mozilla list, so that prompted me to write
this email.

It is true that mozilla won't attempt to use getaddrinfo at all,
falling back to use of gethostbyname if it senses that IPv6 support is
not present on the system.  But for those who might feel it odd to
rebuild their kernel just to make mozilla behave better in this
respect, there is another solution that I can recommend:

Find the file patch-nsprpub/pr/include/md/_freebsd.h, and in it find
this clause:

     #if __FreeBSD_version >= 400014
     #define _PR_INET6
     #define _PR_HAVE_INET_NTOP
     #define _PR_HAVE_GETHOSTBYNAME2
     ...

Replacing the condition of the #if by something which must be false,
will cause mozilla to build without any of the stuff which causes
mozilla to attempt these IPv6 lookups that fail so annoyingly.

I wonder if this solution might someday be incorporated into the
FreeBSD mozilla port in the form of a compile time option (perhaps
WITHOUT_IPv6_DNS) similar to the other options that now exist?

If there are other solutions to this problem, I'd appreciate knowing
about them as well.

Thanks,
Steven Schwarz



More information about the freebsd-mozilla mailing list