Closed Bug 293946 Opened 19 years ago Closed 6 years ago

jsd or venkman need to try not to cause bad recursion due to the slow script warning

Categories

(Other Applications Graveyard :: Venkman JS Debugger, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: timeless, Assigned: timeless)

References

Details

(Keywords: helpwanted)

vnk: execution hook: function
ProxyServer_startRecording(fileName=string:"C:\\DOCUME~1\\qaUser\\Desktop\\recording-by-proxy.js")
in
<file:/C:/Documents%20and%20Settings/qaUser/Desktop/b1352/all/components/hsProxy.js>
line 1213

...
++WEBSHELL == 17
++DOMWINDOW == 17
WARNING: getting z level of unregistered window, file
r:/mozilla/xpfe/appshell/src/nsWindowMediator.cpp, line 635
++WEBSHELL == 18
++DOMWINDOW == 18
++WEBSHELL == 19
++DOMWINDOW == 19
WARNING: event queue chain length is 6. this is almost certainly a leak., file
r:/mozilla/xpcom/threads/nsEventQueue.cpp, line 553
...
WARNING: event queue chain length is 23. this is almost certainly a leak., file
r:/mozilla/xpcom/threads/nsEventQueue.cpp, line 553
++WEBSHELL == 37
++DOMWINDOW == 37

I'm running w/ a modified promptservice however, based on the stack trace, i
don't think that affects anything (the promptservice chains to the normal
service as shown in the stack)

setup:
1. run mozilla
2. open venkman
3. rename xpcom component to components/foo.js
4. /fbreak foo 1
5. in venkman execute:
Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar).autoRegister(null)
6. set better breakpoints in foo.js
7. continue
8. use Components.classes to poke foo (with a breakpoint set)
9. step (fairly slowly, this is a debug build) through the code
10. at some point, get distracted and wander off (maybe for an hour or more)
11. when you get back, notice that the system is unhappy and spitting out
WARNING: event queue chain length ...

summary of stack:
000b8c98 0241a059 nsXULWindow::ShowModal
000b8fac 01363436 embedcomponents!nsWindowWatcher::OpenWindowJS(...,
"chrome://global/content/commonDialog.xul", ...)

000b9258 01bd8cf2 embedcomponents!nsPrompt::ConfirmEx("Warning: Unresponsive
script", "A script on this page may be busy, or it may have stopped responding.
You can stop the script now, or you can continue to see if the script will
complete.", ..., "Stop script", "Continue", ...)
000b93b0 00d9f0a6 gklayout!nsJSContext::DOMBranchCallback

{venkman}js_Invoke..js_Invoke..array_sort/jsHeapSort../js_internalInvoke..js_Interpret
{venkman-xpconnect-trampoline-newscripthook}
xpc3250!nsXPCWrappedJSClass::CallMethod
...
000bd074 00dfb87b jsd3250!jsd_NewScriptHookProc(...,
"chrome://global/content/bindings/dialog.xml", ...)
...
000bd22c 00d60bf7 js3250!JS_CompileUCScriptForPrincipals(...,
"chrome://global/content/bindings/dialog.xml", 0x21)
...
000bd3c4 01b9de22 gklayout!nsXBLProtoImplField::InstallMember
000bd55c 018c2dc0 gklayout!nsXBLService::LoadBindings
000bd654 018cbbfc gklayout!nsCSSFrameConstructor::ConstructDocElementFrame
...
000bde64 01bc22c7 gklayout!nsXULDocument::ResumeWalk
...
000bdecc 004b54a7 xpcom_core!PL_HandleEvent
...
000bdff8 0241d444 gkwidget!nsAppShell::DispatchNativeEvent
000be090 0241a059 appshell!nsXULWindow::ShowModal
...<recursion snipped>...
0011eb48 0241a059 appshell!nsXULWindow::ShowModal
0011ee5c 01363436 embedcomponents!nsWindowWatcher::OpenWindowJS(...,
"chrome://global/content/commonDialog.xul")
0011f108 01bd8cf2 embedcomponents!nsPrompt::ConfirmEx("Warning: Unresponsive
script", "A script on this page may be busy, or it may have stopped responding.
You can stop the script now, or you can continue to see if the script will
complete.", 0x7f7f, "Stop script", "Continue", ...)
0011f260 00d9f0a6 gklayout!nsJSContext::DOMBranchCallback
0011fb9c 00d9c9cd js3250!js_Interpret
...
{venkman}js_Invoke..js_Invoke..array_sort/jsHeapSort../js_internalInvoke..js_Interpret
{venkman-xpconnect-trampoline-newscripthook}

00123150 01bdaa14 js3250!JS_CompileUCFunctionForPrincipals(..., "onxblkeypress",
..., "dispatch('cont', {isInteractive: true});", ...)
001231c4 01b941d8 gklayout!nsJSContext::CompileEventHandler
00123778 01b92a65 gklayout!nsXBLPrototypeHandler::ExecuteHandler
...
001239d8 01b83949 gklayout!nsXBLWindowKeyHandler::WalkHandlers
001239ec 01b255f1 gklayout!nsXBLWindowKeyHandler::KeyPress
..
00123ddc 01ba5465 gklayout!nsXULElement::HandleDOMEvent
...
00126cf8 01ba74fd gklayout!nsXULElement::HandleDOMEvent
...
00127d3c 004d49d7 jsd3250!jsdService::EnterNestedEventLoop
...
001290b8 003c94df jsd3250!jsd_CallExecutionHook
001290ec 00d73467 jsd3250!jsd_TrapHandler
00129114 00dae7a6 js3250!JS_HandleTrap
00129a58 00d9c9cd js3250!js_Interpret
{xpconnect/js/xpconnect... bouncing from venkman's keyboard handler of <enter>
to dispatch the command which eventually triggered the breakpoint}
...
0012fda0 0246cd28 USER32!DispatchMessageW
0012fe04 021accbe gkwidget!nsAppShell::Run
...
0012ff68 0041640c mozilla!main
...
0012fff0 00000000 kernel32!BaseProcessStart

all total, 1361 stack frames and at least 15 slow script dialogs (i think closer
to 22).

what bad things would happen if the js_CallNewScriptHook callee
(jsd_NewScriptHookProc/jsds_ScriptHookProc) called JS_UNKEEP_ATOMS(...),
constructed a plevent (stashing all the pieces it needed), and dispatched it.
and when the plevent fired it would pause jsds, call onscriptcreated,
unpause jsds and js_keep_atoms and clean itself up.

gJsds->mPauseLevel = 0x16
       mNestedLoopLevel = 1
Blocks: 293974
QA Contact: caillon → venkman
Component is obsolete so resolving bugs as INCOMPLETE
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.