Closed Bug 18702 Opened 25 years ago Closed 25 years ago

[dogfood]Javascript Alert doesn't work

Categories

(Core :: JavaScript Engine, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: morse, Assigned: jband_mozilla)

Details

Javascript alerts no longer work. Just started happening. Here is html code which demonstrates the problem: <html> <head> <script> alert("this is a javascript message"); </script> </head> <body> </body> </html> Instead of getting the alert, a javascript uncaught-exception message appears on the console.
Summary: Javascript Alert doesn't work
Assignee: mccabe → brendan
'alert' is not part of the JS engine. Brendan landed a number of tweaks to engine internals yesterday that I understand didn't go totally smoothly; reassigning to him in case that's the problem. Failing that, it should probably go to the DOM component.
Assignee: brendan → jband
I tried this and got a security exception for a use of the XPConnect services from web code. The stack looks like nsScriptSecurityManager::CheckXPCPermissions(nsScriptSecurityManager * const 0x01233f50, JSContext * 0x01e3d600) line 1035 nsScriptSecurityManager::CanCreateWrapper(nsScriptSecurityManager * const 0x01233f54, JSContext * 0x01e3d600, const nsID & {...}, nsISupports * 0x032ec590) line 747 nsXPCWrappedNative::GetNewOrUsedWrapper(XPCContext * 0x01e89f60, nsISupports * 0x032ec590, const nsID & {...}, unsigned int * 0x00000000) line 154 + 66 bytes XPCConvert::NativeData2JS(JSContext * 0x01e3d600, long * 0x02550900, const void * 0x0012e8fc, const nsXPTType & {...}, const nsID * 0x017cdbc8 iid, unsigned int * 0x00000000) line 362 + 50 bytes XPC_JSArgumentFormatter(JSContext * 0x01e3d600, const char * 0x017cdf83, int 0, long * * 0x0012e964, char * * 0x0012e98c) line 960 + 27 bytes TryArgumentFormatter(JSContext * 0x01e3d600, const char * * 0x0012e988, int 0, long * * 0x0012e964, char * * 0x0012e98c) line 121 + 26 bytes JS_PushArgumentsVA(JSContext * 0x01e3d600, void * * 0x0012e9dc, const char * 0x017cdf86, char * 0x0012e9b8) line 342 + 23 bytes JS_PushArguments(JSContext * 0x01e3d600, void * * 0x0012e9dc, const char * 0x017cdf80) line 259 + 21 bytes nsCommonDialogs::DoDialog(nsCommonDialogs * const 0x032ce0b0, nsIDOMWindow * 0x01e3d7d8, nsIDialogParamBlock * 0x032ec590, const char * 0x017cded0) line 299 + 40 bytes nsCommonDialogs::Alert(nsCommonDialogs * const 0x032ce0b0, nsIDOMWindow * 0x01e3d7d8, const unsigned short * 0x00000000, const unsigned short * 0x0012eab8) line 114 + 27 bytes nsWebShellWindow::Alert(nsWebShellWindow * const 0x01df8f68, const unsigned short * 0x0012eab8) line 3003 + 38 bytes GlobalWindowImpl::Alert(GlobalWindowImpl * const 0x02737e88, JSContext * 0x02736b00, long * 0x02530c3c, unsigned int 1) line 1115 + 31 bytes WindowAlert(JSContext * 0x02736b00, JSObject * 0x023e9820, unsigned int 1, long * 0x02530c3c, long * 0x0012ec38) line 1129 + 27 bytes js_Invoke(JSContext * 0x02736b00, unsigned int 1, unsigned int 0) line 673 + 26 bytes js_Interpret(JSContext * 0x02736b00, long * 0x0012f514) line 2250 + 15 bytes js_Execute(JSContext * 0x02736b00, JSObject * 0x023e9820, JSScript * 0x032dc760, JSFunction * 0x00000000, JSStackFrame * 0x00000000, int 0, long * 0x0012f514) line 846 + 13 bytes JS_EvaluateUCScriptForPrincipals(JSContext * 0x02736b00, JSObject * 0x023e9820, JSPrincipals * 0x032f02e4, const unsigned short * 0x0012fa44, unsigned int 50, const char * 0x032f0220, unsigned int 3, long * 0x0012f514) line 2692 + 27 bytes nsJSContext::EvaluateString(nsJSContext * const 0x02737e20, const nsString & {...}, void * 0x023e9820, nsIPrincipal * 0x032f02e0, const char * 0x032f0220, unsigned int 3, const char * 0x00000000, nsString & {...}, int * 0x0012f54c) line 226 + 53 bytes HTMLContentSink::EvaluateScript(nsString & {...}, int 3, const char * 0x00000000) line 3591 HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode & {...}) line 3814 HTMLContentSink::AddLeaf(HTMLContentSink * const 0x03315a00, const nsIParserNode & {...}) line 2604 + 12 bytes CNavDTD::AddLeaf(const nsIParserNode & {...}) line 2866 + 22 bytes CNavDTD::AddHeadLeaf(nsIParserNode & {...}) line 2982 + 14 bytes CNavDTD::HandleStartToken(CToken * 0x01dd1ae0) line 1286 + 12 bytes CNavDTD::HandleToken(CNavDTD * const 0x032f72f0, CToken * 0x0231c350, nsIParser * 0x03315bb0) line 657 + 12 bytes CNavDTD::BuildModel(CNavDTD * const 0x032f72f0, nsIParser * 0x03315bb0, nsITokenizer * 0x032f7050, nsITokenObserver * 0x00000000, nsIContentSink * 0x03315a00) line 461 + 20 bytes nsParser::BuildModel() line 1023 + 34 bytes nsParser::ResumeParse(nsIDTD * 0x00000000, int 0) line 950 + 11 bytes nsParser::OnDataAvailable(nsParser * const 0x03315bb4, nsIChannel * 0x0331de70, nsISupports * 0x00000000, nsIInputStream * 0x03311768, unsigned int 0, unsigned int 125) line 1301 + 19 bytes nsDocumentBindInfo::OnDataAvailable(nsDocumentBindInfo * const 0x0331ba50, nsIChannel * 0x0331de70, nsISupports * 0x00000000, nsIInputStream * 0x03311768, unsigned int 0, unsigned int 125) line 1219 + 32 bytes nsChannelListener::OnDataAvailable(nsChannelListener * const 0x0331df30, nsIChannel * 0x0331de70, nsISupports * 0x00000000, nsIInputStream * 0x03311768, unsigned int 0, unsigned int 125) line 1405 nsHTTPResponseListener::OnDataAvailable(nsHTTPResponseListener * const 0x03313ca0, nsIChannel * 0x03311400, nsISupports * 0x0331de70, nsIInputStream * 0x03311768, unsigned int 0, unsigned int 125) line 175 + 47 bytes nsOnDataAvailableEvent::HandleEvent(nsOnDataAvailableEvent * const 0x033113b0) line 417 nsStreamListenerEvent::HandlePLEvent(PLEvent * 0x03313980) line 173 + 12 bytes PL_HandleEvent(PLEvent * 0x03313980) line 537 + 10 bytes PL_ProcessPendingEvents(PLEventQueue * 0x0172e810) line 498 + 9 bytes _md_EventReceiverProc(HWND__ * 0x00b706e2, unsigned int 49361, unsigned int 0, long 24307728) line 972 + 9 bytes USER32! 77e71820() 0172e810() jband is working on a refactoring of XPConnect so that calls to XPConnect from native code won't be subject to script security checks. In the meantime, you can disable these checks by setting the preference "security.checkxpconnect" to false in all.js.
Status: NEW → ASSIGNED
Summary: Javascript Alert doesn't work → [dogfood]Javascript Alert doesn't work
Yes, norris and I discussed that this sort of side effect of xpconnect security checks might surface. I have a plan. I'll write an auto class to track whether the current call into xpconnect is coming from js or native. Instances of the class will be at each entry point into xpconnect and will in effect be a virtual stack of this info. The security system will only get called when the 'current' call into the system is from js code. I won't be ready to land my refactored stuff right away (and it depends on DOM changes that brendan is doing). This sounds like dogfood to me so I'll implement this on my trunk version of the code asap and get it checked in.
Depends on: 17736
No longer depends on: 17736
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
fixed with a caller type tracking scheme in xpconnect. I checked this into the trunk.
Verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.