Closed Bug 133593 Opened 23 years ago Closed 23 years ago

Save Page As... "Web Page, complete" locks up browser on this site

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
critical

Tracking

()

VERIFIED DUPLICATE of bug 133669

People

(Reporter: ddkilzer, Assigned: jst)

References

()

Details

(Keywords: hang, testcase)

UA: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020312 (Red Hat 6.2 SRPM from mozilla.org: mozilla-0.9.9-0.i386.rpm) To reproduce: 1. Open URL mentioned above. 2. Select "Save Page As..." from the "File" menu. 3. Select "Web Page, complete" from the dialog box. 4. Click on "Save" button. 5. Wait, or use debugger to stop process. NOTE: Saving as "Web Page, HTML only" works fine. This site is unique(?) in that nearly all of its page content is derived from the output of JavaScript functions. I'm guessing that this is where the problem lies. "DOM Level 0" for the component of this bug is a complete guess on my part. INTERESTING SIDE NOTE: The pop-up menus on the left side of the web page (under the *ahem* "Find a Babe" heading) are double- populated under Mozilla 0.9.9 _and_ not selectable. Under Netscape Communicator 4.77 on this same computer they work fine. It may be possible that this is the problem causing the lock-up when the HTML is written out. LAST BUT NOT LEAST: "A friend sent this link to me." :^)
Add keyword: hang. Here's my attempt at a stack trace under Linux. I followed the steps I outlined in the description, then once the process hung, I connected to it via GDB and ran 'where'. (gdb) where #0 0x409c2573 in nsGenericElement::GetNextSibling () from /usr/lib/mozilla/components/libgkcontent.so #1 0x4088aa5b in nsHTMLOptionElement::GetNextSibling () from /usr/lib/mozilla/components/libgkcontent.so #2 0x405dcb11 in nsDOMWalker::WalkDOM () from /usr/lib/mozilla/components/libembedcomponents.so #3 0x405d84e6 in nsWebBrowserPersist::SaveDocumentInternal () from /usr/lib/mozilla/components/libembedcomponents.so #4 0x405d57a3 in nsWebBrowserPersist::SaveDocument () from /usr/lib/mozilla/components/libembedcomponents.so #5 0x40184201 in XPTC_InvokeByIndex () from /usr/lib/libxpcom.so #6 0x406797f9 in XPCWrappedNative::CallMethod () from /usr/lib/mozilla/components/libxpconnect.so #7 0x4067f0f5 in XPC_WN_CallMethod () from /usr/lib/mozilla/components/libxpconnect.so #8 0x40091142 in js_Invoke () from /usr/lib/libmozjs.so #9 0x40098ec2 in js_Interpret () from /usr/lib/libmozjs.so #10 0x40091190 in js_Invoke () from /usr/lib/libmozjs.so #11 0x4067559d in nsXPCWrappedJSClass::CallMethod () from /usr/lib/mozilla/components/libxpconnect.so #12 0x40671d01 in nsXPCWrappedJS::CallMethod () from /usr/lib/mozilla/components/libxpconnect.so #13 0x401843a4 in PrepareAndDispatch () from /usr/lib/libxpcom.so #14 0x40184432 in nsXPTCStubBase::Stub4 () from /usr/lib/libxpcom.so #15 0x406ca79a in nsURIChecker::SetStatusAndCallBack () from /usr/lib/mozilla/components/libnecko.so #16 0x406cae0f in nsURIChecker::OnStartRequest () from /usr/lib/mozilla/components/libnecko.so #17 0x406fa54f in nsHttpChannel::OnStartRequest () from /usr/lib/mozilla/components/libnecko.so #18 0x4070d744 in nsOnStartRequestEvent::HandleEvent () from /usr/lib/mozilla/components/libnecko.so #19 0x406b8804 in nsARequestObserverEvent::HandlePLEvent () from /usr/lib/mozilla/components/libnecko.so #20 0x4016ede7 in PL_HandleEvent () from /usr/lib/libxpcom.so #21 0x4016ed03 in PL_ProcessPendingEvents () from /usr/lib/libxpcom.so #22 0x4016fc38 in nsEventQueueImpl::ProcessPendingEvents () from /usr/lib/libxpcom.so #23 0x40b15853 in event_processor_callback () from /usr/lib/mozilla/components/libwidget_gtk.so #24 0x40b155cd in our_gdk_io_invoke () from /usr/lib/mozilla/components/libwidget_gtk.so #25 0x4037e4ba in g_io_unix_dispatch (source_data=0x81ae290, current_time=0xbffff790, user_data=0x81bde10) at giounix.c:135 #26 0x4037f9f6 in g_main_dispatch (dispatch_time=0xbffff790) at gmain.c:656 #27 0x4037ffb1 in g_main_iterate (block=1, dispatch=1) at gmain.c:877 #28 0x40380129 in g_main_run (loop=0x81bde20) at gmain.c:935 #29 0x4029b48a in gtk_main () at gtkmain.c:524 #30 0x40b15ce4 in nsAppShell::Run () ---Type <return> to continue, or q <return> to quit--- from /usr/lib/mozilla/components/libwidget_gtk.so #31 0x40af5016 in nsAppShellService::Run () from /usr/lib/mozilla/components/libnsappshell.so #32 0x804ffa9 in DoCommandLines () #33 0x80507f7 in main () #34 0x4047f9cb in __libc_start_main (main=0x80506c8 <main>, argc=1, argv=0xbffff924, init=0x804c0f8 <_init>, fini=0x8051c50 <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbffff91c) at ../sysdeps/generic/libc-start.c:92 (gdb) quit
Keywords: hang
UA: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.9) Gecko/20020311 I have confirmed that the same problem occurs on Mozilla 0.9.9 (build info above in UA string) on Windows 98 (under VMWare). Unfortunately, I don't have a way to get a stack trace under Windows, and I'm not sure how to activate the talkback feature after a hang (or if that's even possible).
Add CC for Bug 133669 reporter. :^)
Adam--should you or I investigate this? Could it be an infinite loop in the dom walker code?
This site causes my trunk Mozilla to exit. I'm investigating in 0.9.9 right now. First impressions suggest it's caught in a loop by an HTML option element with a single child text node ("Any Date"). It could be an issue in the DOM walker when a node has only one child node, something which may not occur in normal HTML.
This does appear to be an odd DOM issue. I step debugged through and the reason for the error is that the option element (with the "Any Date" text child) is it's parents node list twice, at positions 0 & 1 with the same pointer. The code in GetNextSibling is broken when this happens, since it works out the next sibling by adding 1 to index of the current sibling. The index of the current sibling is returned "mParent->IndexOf(this, pos)" which returns the index of the first matching pointer. So GetNextSibling returns the pointer at ++pos in the list (==1) which is the bogus entry. The next time GetNextSibling is called, IndexOf again returns 0 again (because its pointer matches the first entry even though this is the second entry) and the loop continues forever, returning the element at 1 all the time. So nsDOMWalker isn't broken. It is calling GetNextSibling correctly, but GetNextSibling keeps returning the same node over and over because the node appears twice in the list.
jst--can you fix this for 1.0? :-)
Keywords: nsbeta1
I don't know much about Mozilla internals, but I do know this: The 'Any Date' text child should **NOT** appear twice in the list in the first place. The JavaScript that generates this HTML is in the ui.js file: http://lib.jailbabes.com/js/ui.js It declares a variable, 'withins' on line 64: var withins = new Array ('Any Date','One Week','Two Weeks','Three Weeks','One Month','Two Months','Three Months'); Then in function SearchTray() (begins on line 356 of ui.js) there is a for() loop (lines 375-376) that outputs the HTML for the list box (which is getting two of every item in the 'withins' array): for (i=0; i<withins.length; i++) document.write ( '<OPTION VALUE="' + i + '"' + ((i == searchi.within) ? ' SELECTED' : '') + '>' + withins[i] + '\n'); Note that this for() loop does NOT use curly brackets, so it should be iterating over the next line. However, it *appears* that instead of iterating only ONCE, the code iterates over the line TWICE. (Purely a guess on my part, though.) In both MSIE 5.5 on Windows and Netscape Communicator 4.77 on Linux, every item in the select list only appears ONCE. In short, this could be a JavaScript Engine bug rather than a DOM bug. I'm sorry I don't have the time or the expertise to verify this, though. :^(
The url mentioned in the comment #0 crashes the browser for me while trying to load with build 2002040110 on WinNT: Incident ID 4752723 Stack Signature nsString::nsString 3abca528 Trigger Time 2002-04-02 16:52:11 Email Address jpatel@netscape.com URL visited http://www.jailbabes.com/home.db Build ID 2002040110 Product ID MozillaTrunk Platform Operating System Win32 Module Trigger Reason Stack overflow User Comments just loading http://www.jailbabes.com/home.db in a new tab... Stack Trace nsString::nsString [d:\builds\seamonkey\mozilla\string\obsolete\nsString2.cpp, line 68] nsWindowRoot::HandleChromeEvent [d:\builds\seamonkey\mozilla\dom\src\base\nsWindowRoot.cpp, line 182] GlobalWindowImpl::HandleDOMEvent [d:\builds\seamonkey\mozilla\dom\src\base\nsGlobalWindow.cpp, line 693] nsXULDocument::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\document\src\nsXULDocument.cpp, line 2449] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3449] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3442] nsXULElement::HandleChromeEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 4690] GlobalWindowImpl::HandleDOMEvent [d:\builds\seamonkey\mozilla\dom\src\base\nsGlobalWindow.cpp, line 693] nsDocument::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 3230] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1636] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsHTMLFormElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLFormElement.cpp, line 605] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1630] nsHTMLSelectElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 1798] nsEventStateManager::DispatchNewEvent [d:\builds\seamonkey\mozilla\content\events\src\nsEventStateManager.cpp, line 4073] nsEventListenerManager::DispatchEvent [d:\builds\seamonkey\mozilla\content\events\src\nsEventListenerManager.cpp, line 2661] nsDOMEventRTTearoff::DispatchEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 545] nsHTMLSelectElement::SetOptionsSelectedByIndex [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 1327] nsHTMLSelectElement::InsertOptionsIntoList [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 467] nsHTMLSelectElement::WillAddOptions [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 668] nsHTMLSelectElement::AppendChildTo [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 377] SinkContext::FlushTags [d:\builds\seamonkey\mozilla\content\html\document\src\nsHTMLContentSink.cpp, line 2147] HTMLContentSink::BeginUpdate [d:\builds\seamonkey\mozilla\content\html\document\src\nsHTMLContentSink.cpp, line 4891] nsDocument::BeginUpdate [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 1628] nsGenericDOMDataNode::SetText [d:\builds\seamonkey\mozilla\content\base\src\nsGenericDOMDataNode.cpp, line 1251] FindChar1 [d:\builds\seamonkey\mozilla\string\obsolete\bufferRoutines.h, line 427] nsFSURLEncoded::AddRef [d:\builds\seamonkey\mozilla\content\html\content\src\nsFormSubmission.cpp, line 403] nsDocument::CloneNode [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 3115] nsDocument::CloneNode [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 3115] nsGenericDOMDataNode::SetText [d:\builds\seamonkey\mozilla\content\base\src\nsGenericDOMDataNode.cpp, line 1284] SheetLoadData::AddRef [d:\builds\seamonkey\mozilla\content\html\style\src\nsCSSLoader.cpp, line 501] SheetLoadData::AddRef [d:\builds\seamonkey\mozilla\content\html\style\src\nsCSSLoader.cpp, line 501] nsSelection::Release [d:\builds\seamonkey\mozilla\content\base\src\nsSelection.cpp, line 1037] nsSelection::RepaintSelection [d:\builds\seamonkey\mozilla\content\base\src\nsSelection.cpp, line 2940] nsSelection::GetFrameForNodeOffset [d:\builds\seamonkey\mozilla\content\base\src\nsSelection.cpp, line 2951] nsSelection::WordMove [d:\builds\seamonkey\mozilla\content\base\src\nsSelection.cpp, line 3090] Another user crashes at the same site, but with a different stack signature: Incident ID 4522145 Stack Signature nsEventListenerManager::HandleEvent f88a8ab2 Trigger Time 2002-03-26 23:10:21 Email Address ac_gyrefalcon@hotmail.com URL visited http://www.jailbabes.com/home.db Build ID 2002032211 Product ID MozillaTrunk Platform Operating System Win32 Module Trigger Reason Stack overflow User Comments Crashed trying to repro hang in bug 133593. oops! Stack Trace nsEventListenerManager::HandleEvent [d:\builds\seamonkey\mozilla\content\events\src\nsEventListenerManager.cpp, line 1243] nsWindowRoot::HandleChromeEvent [d:\builds\seamonkey\mozilla\dom\src\base\nsWindowRoot.cpp, line 182] GlobalWindowImpl::HandleDOMEvent [d:\builds\seamonkey\mozilla\dom\src\base\nsGlobalWindow.cpp, line 693] nsXULDocument::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\document\src\nsXULDocument.cpp, line 2449] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3445] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 3438] nsXULElement::HandleChromeEvent [d:\builds\seamonkey\mozilla\content\xul\content\src\nsXULElement.cpp, line 4686] GlobalWindowImpl::HandleDOMEvent [d:\builds\seamonkey\mozilla\dom\src\base\nsGlobalWindow.cpp, line 693] nsDocument::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 3232] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1635] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsHTMLFormElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLFormElement.cpp, line 605] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1629] nsHTMLSelectElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 1790] nsEventStateManager::DispatchNewEvent [d:\builds\seamonkey\mozilla\content\events\src\nsEventStateManager.cpp, line 4049] nsEventListenerManager::DispatchEvent [d:\builds\seamonkey\mozilla\content\events\src\nsEventListenerManager.cpp, line 2661] nsDOMEventRTTearoff::DispatchEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 545] nsHTMLSelectElement::SetOptionsSelectedByIndex [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 1324] nsHTMLSelectElement::InsertOptionsIntoList [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 464] nsHTMLSelectElement::WillAddOptions [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 665] nsHTMLSelectElement::AppendChildTo [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLSelectElement.cpp, line 374] SinkContext::FlushTags [d:\builds\seamonkey\mozilla\content\html\document\src\nsHTMLContentSink.cpp, line 2123] HTMLContentSink::BeginUpdate [d:\builds\seamonkey\mozilla\content\html\document\src\nsHTMLContentSink.cpp, line 4868] nsDocument::BeginUpdate [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 1628] nsGenericDOMDataNode::SetText [d:\builds\seamonkey\mozilla\content\base\src\nsGenericDOMDataNode.cpp, line 1246] FindChar1 [d:\builds\seamonkey\mozilla\string\obsolete\bufferRoutines.h, line 427] nsHTMLFrameElement::AddRef [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLFrameElement.cpp, line 136] nsDocument::CloneNode [d:\builds\seamonkey\mozilla\content\base\src\nsDocument.cpp, line 3117] nsHTMLLegendElement::SubmitNamesValues [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLLegendElement.cpp, line 255] 0x8510758b Adding crash, topcrash+ and testcase keywords and changing OS to All. There are other crashes with the nsEventListenerManager::HandleEvent being reported by Talkback, but I'm not sure if they're related or not.
OS: Linux → All
Summary: Save Page As... "Web Page, complete" locks up browser on this site → Save Page As... "Web Page, complete" locks up browser on this site - Trunk [@ nsString::nsString][@ nsEventListenerManager::HandleEvent]
Moving all crash related informatin to bug 133669 to avoid any further confusion. Since this bug was originally reported for locking up the browser...I'll leave it alone. If anyone thinks this should just be marked a dup of 133699, please feel free.
Keywords: crash, topcrash+
Summary: Save Page As... "Web Page, complete" locks up browser on this site - Trunk [@ nsString::nsString][@ nsEventListenerManager::HandleEvent] → Save Page As... "Web Page, complete" locks up browser on this site
Will retest on Linux using Bug 133669 when RC1 lands. *** This bug has been marked as a duplicate of 133669 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Verified Dupe
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.