Comment 10 for bug 113201

Revision history for this message
In , Stewart (stewart-235853) wrote :

Copied from bug #224447

 ------- Additional Comment #6 From mike 2004-01-20 17:17 PST [reply] -------

Also experiencing this. Firebird 0.8+ MacOS X
Resolving Host takes about 5 seconds for any page with a new DNS. For example,
if i go to www.google.com, it will hang for a few secs at resolving host before
loading, but then anything i do within google will be snappy. But, say i click
a link from google to another site, it will hang for another few seconds until i
can get into that new site's DNS.

------- Additional Comment #7 From <email address hidden> 2004-02-17 05:38 PST
[reply] -------

This ought to be renamed to "Complete hang when DNS resolving/lookup"

I see this too, but not always (local site dns cacheing?) -- and experienced
this also when using Mozilla.

Note: IE does not hang -- that is, its menus etc still function, it can redraw
etc while the lookup occurs.

(Firefox 0.8, Win2K, via a proxy squid/2.5.STABLE3)

------- Additional Comment #9 From Stewart Jeacocke 2004-02-25 06:30 PST [reply]
-------

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040224

As of 23/02/04 I'm still seeing this bug on the SeaMonkey CVS Tree. The UI
(every windows and tab) is blocked while name resolution is performed. This is a
real PITA particulary for sites which have many adds etc. For example it can
take over 30s for http://www.ebay.co.uk to load during which time the UI is
completely hung.

This bug seems to be due to two things
i) The UI is blocked during host resolution
AND
ii) Host resolution in mozilla is sometimes very slow, even when the dns names
have already been cached at a local DNS server. For example I used the "host"
command to resolve all the names required for www.ebay.co.uk and none of them
took longer than 0.05s to resolve

------- Additional Comment #10 From Stewart Jeacocke 2004-02-25 06:42 PST
[reply] -------

This bug is not specific to Firefox. Would it be a good idea to change "Product"
to something other than FireFox?

I've stuck some cout statements at the beginning and end of nsDNSService::
Resolve() [nsDNSService2.cpp] and can confirm that we are inside this method
when the UI hangs.

I'm willing to help track down the cause of this bug (as its making me have to
use Opera ;-) ) but I have no experience with the internals of mozilla so would
need guidance as to where to start looking.

------- Additional Comment #11 From Stewart Jeacocke 2004-02-25 12:56 PST
[reply] -------

It seems that this bug is triggered by something in my preferences. I moved my
.mozilla directory out of the way and let mozilla create a new one. This caused
the bug to disappear (at least on current CVS and mozilla 1.6).

When using my old .mozilla dir (the config the elicits this bug) the method
nsDNSService::Resolve() is being called lots, however when I let mozilla create
.mozilla from scratch nsDNSService::Resolve() is never called and is replaced by
calls to nsDNSService::AsyncResolve()

------- Additional Comment #12 From Stewart Jeacocke 2004-02-25 14:30 PST
[reply] -------

The offending preference is enabling Proxy Auto Config (PAC).

When I enable PAC (set to use a valid remote PAC file) the
nsDNSService::Resolve() method is used. When I either manually set the proxy
config or select "direct connection" the nsDNSService::AsyncResolve() method is
called.

SUMMARY
Using Proxy Auto Config stops DNS resolution from happening asynchronously. This
causes the UI to hang while name resolution occurs.

------- Additional Comment #13 From Jason Barnabe 2004-02-25 14:47 PST [reply]
-------

Moving to Browser, good work Stewart.

------- Additional Comment #14 From Jason Barnabe 2004-02-25 14:49 PST [reply]
-------

*** Bug 213751 has been marked as a duplicate of this bug. ***

------- Additional Comment #15 From Stewart Jeacocke 2004-02-27 03:08 PST
[reply] -------

Not sure if this helps but this is a example bracktrace that I get if I set a
breakpoint on the nsDNSService::Resolve() method (with proxy auto config
enabled).

#0 nsDNSService::Resolve(nsACString const&, int, nsIDNSRecord**)
(this=0x8110a50, hostname=@0x889d658, bypassCache=0, resul$
#1 0x4012a025 in XPTC_InvokeByIndex () from ./libxpcom.so
#2 0x4089e3b7 in XPCWrappedNative::CallMethod(XPCCallContext&,
XPCWrappedNative::CallMode) (ccx=@0xbfffe650, mode=CALL_METH$
#3 0x408a8913 in XPC_WN_CallMethod(JSContext*, JSObject*, unsigned, long*,
long*) (cx=0x818cce0, obj=0x87fd680, argc=2, arg$
#4 0x401b2770 in js_Invoke (cx=0x818cce0, argc=2, flags=0) at jsinterp.c:941
#5 0x401c0660 in js_Interpret (cx=0x818cce0, result=0xbfffedcc) at
jsinterp.c:2962
#6 0x401b27ea in js_Invoke (cx=0x818cce0, argc=3, flags=2) at jsinterp.c:958
#7 0x40896e3b in nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS*, unsigned
short, nsXPTMethodInfo const*, nsXPTCMiniVariant$
#8 0x4088fd2f in nsXPCWrappedJS::CallMethod(unsigned short, nsXPTMethodInfo
const*, nsXPTCMiniVariant*) (this=0x88ef1a0, me$
#9 0x4012a396 in PrepareAndDispatch (methodIndex=4, self=0x88ef1a0,
args=0xbffff214) at xptcstubs_gcc_x86_unix.cpp:100
#10 0x40ad6c23 in nsStreamListenerTee::OnStopRequest(nsIRequest*,
nsISupports*, unsigned) (this=0x81e8ba0, request=0x8854778$
#11 0x40b780a6 in nsHttpChannel::OnStopRequest(nsIRequest*, nsISupports*,
unsigned) (this=0x8854778, request=0x88c1898, ctxt$
#12 0x40aae8ca in nsInputStreamPump::OnStateStop() (this=0x88c1898) at
nsInputStreamPump.cpp:498
#13 0x40aae2e8 in nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)
(this=0x88c1898, stream=0x889d4cc) at nsInputS$
#14 0x400d87c7 in nsInputStreamReadyEvent::EventHandler(PLEvent*)
(plevent=0x8891454) at nsStreamUtils.cpp:118
#15 0x400fc41b in PL_HandleEvent (self=0x8891454) at plevent.c:671
#16 0x400fc2d0 in PL_ProcessPendingEvents (self=0x80bd5a8) at plevent.c:606
#17 0x400ff4ec in nsEventQueueImpl::ProcessPendingEvents() (this=0x80bd570) at
nsEventQueue.cpp:391
#18 0x416ec720 in event_processor_callback (data=0x80bd570, source=9,
condition=GDK_INPUT_READ) at nsAppShell.cpp:186
#19 0x416ec0cd in our_gdk_io_invoke (source=0x81ec768, condition=G_IO_IN,
data=0x81ee1f0) at nsAppShell.cpp:71
#20 0x4042fa56 in g_io_add_watch () from /usr/lib/libglib-1.2.so.0
#21 0x4043103d in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#22 0x404314f4 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#23 0x40431724 in g_main_run () from /usr/lib/libglib-1.2.so.0
#24 0x40358c3f in gtk_main () from /usr/lib/libgtk-1.2.so.0
#25 0x416ecb4e in nsAppShell::Run() (this=0x811dca0) at nsAppShell.cpp:317
#26 0x4169c4cc in nsAppShellService::Run() (this=0x811d408) at
nsAppShellService.cpp:483
#27 0x080570e9 in main1 (argc=1, argv=0xbffff744, nativeApp=0x809e540) at
nsAppRunner.cpp:1291
#28 0x08057d16 in main (argc=1, argv=0xbffff744) at nsAppRunner.cpp:1678