Closed Bug 289156 Opened 19 years ago Closed 19 years ago

[FIXr]accessing responseText on a XMLHttpRequest Object crashes when mimetype is set to gzip

Categories

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

DEC
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: toddf, Assigned: bzbarsky)

Details

(Keywords: crash)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050403 Firefox/1.0.1

Setting up the request like this:

req = new XMLHttpRequest();
req.overrideMimeType("gzip");

...

After readystate notifies me that the document is finished loading the
reponseXML object is null but when accessing the responseText I get the
following stack trace:

>	xmlextras.dll!nsXMLHttpRequest::DetectCharset(nsACString & aCharset={...}) 
Line 494 + 0x1f	C++
 	xmlextras.dll!nsXMLHttpRequest::ConvertBodyToText(nsAString &
aOutBuffer={...})  Line 523 + 0xf	C++
 	xmlextras.dll!nsXMLHttpRequest::GetResponseText(nsAString &
aResponseText={...})  Line 605 + 0xc	C++
 	xpcom.dll!XPTC_InvokeByIndex(nsISupports * that=0x065ffac0, unsigned int
methodIndex=5, unsigned int paramCount=1, nsXPTCVariant * params=0x0012ad70) 
Line 102	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...},
XPCWrappedNative::CallMode mode=CALL_GETTER)  Line 2034 + 0x1e	C++
 	xpc3250.dll!XPCWrappedNative::GetAttribute(XPCCallContext & ccx={...})  Line
1884 + 0xe	C++
 	xpc3250.dll!XPC_WN_GetterSetter(JSContext * cx=0x065c4028, JSObject *
obj=0x065cae40, unsigned int argc=0, long * argv=0x06609080, long *
vp=0x0012b058)  Line 1319 + 0xc	C++
 	js3250.dll!js_Invoke(JSContext * cx=0x065c4028, unsigned int argc=0, unsigned
int flags=2)  Line 949 + 0x20	C
 	js3250.dll!js_InternalInvoke(JSContext * cx=0x065c4028, JSObject *
obj=0x065cae40, long fval=106742112, unsigned int flags=0, unsigned int argc=0,
long * argv=0x00000000, long * rval=0x0012b9f0)  Line 1043 + 0x14	C
 	js3250.dll!js_InternalGetOrSet(JSContext * cx=0x065c4028, JSObject *
obj=0x065cae40, long id=43859552, long fval=106742112, JSAccessMode
mode=JSACC_READ, unsigned int argc=0, long * argv=0x00000000, long *
rval=0x0012b9f0)  Line 1086 + 0x1f	C
 	js3250.dll!js_GetProperty(JSContext * cx=0x065c4028, JSObject *
obj=0x065cae40, long id=43859552, long * vp=0x0012b9f0)  Line 2768 + 0x30	C
 	js3250.dll!js_Interpret(JSContext * cx=0x065c4028, long * result=0x0012bb38) 
Line 2823 + 0x709	C
 	js3250.dll!js_Invoke(JSContext * cx=0x065c4028, unsigned int argc=1, unsigned
int flags=2)  Line 966 + 0xd	C
 	js3250.dll!js_InternalInvoke(JSContext * cx=0x065c4028, JSObject *
obj=0x0656fb10, long fval=106365544, unsigned int flags=0, unsigned int argc=1,
long * argv=0x065f8830, long * rval=0x0012bccc)  Line 1043 + 0x14	C
 	js3250.dll!JS_CallFunctionValue(JSContext * cx=0x065c4028, JSObject *
obj=0x0656fb10, long fval=106365544, unsigned int argc=1, long *
argv=0x065f8830, long * rval=0x0012bccc)  Line 3698 + 0x1f	C
 	gklayout.dll!nsJSContext::CallEventHandler(JSObject * aTarget=0x0656fb10,
JSObject * aHandler=0x06570268, unsigned int argc=1, long * argv=0x065f8830,
long * rval=0x0012bccc)  Line 1297 + 0x21	C++
 	gklayout.dll!GlobalWindowImpl::RunTimeout(nsTimeoutImpl * aTimeout=0x06608cd8)
 Line 5390	C++
 	gklayout.dll!GlobalWindowImpl::TimerCallback(nsITimer * aTimer=0x06608da8,
void * aClosure=0x06608cd8)  Line 5752	C++
 	xpcom.dll!nsTimerImpl::Fire()  Line 382 + 0x11	C++
 	xpcom.dll!nsTimerManager::FireNextIdleTimer()  Line 616	C++
 	gkwidget.dll!nsAppShell::GetNativeEvent(int & aRealEvent=1, void * &
aEvent=0x01113950)  Line 197	C++
 	appshell.dll!nsXULWindow::ShowModal()  Line 362 + 0x1f	C++
 	appshell.dll!nsWebShellWindow::ShowModal()  Line 1104	C++
 	appshell.dll!nsContentTreeOwner::ShowAsModal()  Line 468	C++
 	embedcomponents.dll!nsWindowWatcher::OpenWindowJS(nsIDOMWindow *
aParent=0x0297854c, const char * aUrl=0x0658ad08, const char * aName=0x0012c498,
const char * aFeatures=0x0012c4f0, int aDialog=1, unsigned int argc=2, long *
argv=0x06070fac, nsIDOMWindow * * _retval=0x0012c624)  Line 786	C++
 	gklayout.dll!GlobalWindowImpl::OpenInternal(const nsAString & aUrl={...},
const nsAString & aName={...}, const nsAString & aOptions={...}, int aDialog=1,
long * argv=0x06070fa0, unsigned int argc=5, nsISupports *
aExtraArgument=0x00000000, nsIDOMWindow * * aReturn=0x0012c9a4)  Line 4983 +
0x8f	C++
 	gklayout.dll!GlobalWindowImpl::OpenDialog(nsIDOMWindow * * _retval=0x0012c9a4)
 Line 3560 + 0x35	C++
 	xpcom.dll!XPTC_InvokeByIndex(nsISupports * that=0x02978550, unsigned int
methodIndex=16, unsigned int paramCount=1, nsXPTCVariant * params=0x0012c9a4)
 Line 102	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...},
XPCWrappedNative::CallMode mode=CALL_METHOD)  Line 2034 + 0x1e	C++
 	xpc3250.dll!XPC_WN_CallMethod(JSContext * cx=0x02977e78, JSObject *
obj=0x02a1b790, unsigned int argc=5, long * argv=0x06070fa0, long *
vp=0x0012cc78)  Line 1287 + 0xe	C++
 	js3250.dll!js_Invoke(JSContext * cx=0x02977e78, unsigned int argc=5, unsigned
int flags=0)  Line 949 + 0x20	C
 	js3250.dll!js_Interpret(JSContext * cx=0x02977e78, long * result=0x0012d5f0) 
Line 2992 + 0xf	C
 	js3250.dll!js_Invoke(JSContext * cx=0x02977e78, unsigned int argc=0, unsigned
int flags=0)  Line 966 + 0xd	C
 	js3250.dll!js_Interpret(JSContext * cx=0x02977e78, long * result=0x0012dee4) 
Line 2992 + 0xf	C
 	js3250.dll!js_Invoke(JSContext * cx=0x02977e78, unsigned int argc=1, unsigned
int flags=2)  Line 966 + 0xd	C
 	js3250.dll!js_InternalInvoke(JSContext * cx=0x02977e78, JSObject *
obj=0x0301b238, long fval=50442832, unsigned int flags=0, unsigned int argc=1,
long * argv=0x0012e1d8, long * rval=0x0012e1e0)  Line 1043 + 0x14	C
 	js3250.dll!JS_CallFunctionValue(JSContext * cx=0x02977e78, JSObject *
obj=0x0301b238, long fval=50442832, unsigned int argc=1, long * argv=0x0012e1d8,
long * rval=0x0012e1e0)  Line 3698 + 0x1f	C
 	gklayout.dll!nsJSContext::CallEventHandler(JSObject * aTarget=0x0301b238,
JSObject * aHandler=0x0301b250, unsigned int argc=1, long * argv=0x0012e1d8,
long * rval=0x0012e1e0)  Line 1297 + 0x21	C++
 	gklayout.dll!nsJSEventListener::HandleEvent(nsIDOMEvent * aEvent=0x06390ea8) 
Line 175 + 0x2b	C++
 	gklayout.dll!nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver *
aReceiver=0x03006290, nsIDOMEvent * aEvent=0x06390ea8)  Line 463	C++
 	gklayout.dll!nsXBLWindowHandler::WalkHandlersInternal(nsIDOMEvent *
aEvent=0x06390ea8, nsIAtom * aEventType=0x00e74d08, nsXBLPrototypeHandler *
aHandler=0x06557188)  Line 297 + 0x18	C++
 	gklayout.dll!nsXBLWindowKeyHandler::WalkHandlers(nsIDOMEvent *
aKeyEvent=0x06390ea8, nsIAtom * aEventType=0x00e74d08)  Line 196	C++
 	gklayout.dll!nsXBLWindowKeyHandler::KeyPress(nsIDOMEvent *
aKeyEvent=0x06390ea8)  Line 249	C++
 	gklayout.dll!DispatchToInterface(nsIDOMEvent * aEvent=0x06390ea8,
nsIDOMEventListener * aListener=0x02dc18a0, unsigned int (nsIDOMEvent *)*
aMethod=0x01d92600, const nsID & aIID={...}, int * aHasInterface=0x0012ea88) 
Line 127 + 0xb	C++
 	gklayout.dll!nsEventListenerManager::HandleEvent(nsIPresContext *
aPresContext=0x02a8cba0, nsEvent * aEvent=0x0012f2c8, nsIDOMEvent * *
aDOMEvent=0x0012ef38, nsIDOMEventTarget * aCurrentTarget=0x02a20274, unsigned
int aFlags=514, nsEventStatus * aEventStatus=0x0012f0f0)  Line 1524 + 0x23	C++
 	gklayout.dll!nsXULDocument::HandleDOMEvent(nsIPresContext *
aPresContext=0x02a8cba0, nsEvent * aEvent=0x0012f2c8, nsIDOMEvent * *
aDOMEvent=0x0012ef38, unsigned int aFlags=514, nsEventStatus *
aEventStatus=0x0012f0f0)  Line 1261	C++
 	gklayout.dll!nsXULElement::HandleDOMEvent(nsIPresContext *
aPresContext=0x02a8cba0, nsEvent * aEvent=0x0012f2c8, nsIDOMEvent * *
aDOMEvent=0x0012ef38, unsigned int aFlags=519, nsEventStatus *
aEventStatus=0x0012f0f0)  Line 2864 + 0x36	C++
 	gklayout.dll!PresShell::HandleEventInternal(nsEvent * aEvent=0x0012f2c8,
nsIView * aView=0x02aaba00, unsigned int aFlags=1, nsEventStatus *
aStatus=0x0012f0f0)  Line 6084 + 0x37	C++
 	gklayout.dll!PresShell::HandleEvent(nsIView * aView=0x02aaba00, nsGUIEvent *
aEvent=0x0012f2c8, nsEventStatus * aEventStatus=0x0012f0f0, int aForceHandle=1,
int & aHandled=1)  Line 5921 + 0x19	C++
 	gklayout.dll!nsViewManager::HandleEvent(nsView * aView=0x02aaba00, nsGUIEvent
* aEvent=0x0012f2c8, int aCaptured=0)  Line 2280	C++
 	gklayout.dll!nsViewManager::DispatchEvent(nsGUIEvent * aEvent=0x0012f2c8,
nsEventStatus * aStatus=0x0012f224)  Line 2066 + 0x14	C++
 	gklayout.dll!HandleEvent(nsGUIEvent * aEvent=0x0012f2c8)  Line 77	C++
 	gkwidget.dll!nsWindow::DispatchEvent(nsGUIEvent * event=0x0012f2c8,
nsEventStatus & aStatus=nsEventStatus_eIgnore)  Line 1067 + 0xa	C++
 	gkwidget.dll!nsWindow::DispatchWindowEvent(nsGUIEvent * event=0x0012f2c8) 
Line 1088	C++
 	gkwidget.dll!nsWindow::DispatchKeyEvent(unsigned int aEventType=131, unsigned
short aCharCode=111, unsigned int aVirtualCharCode=0, long aKeyData=0)  Line
2978 + 0xf	C++
 	gkwidget.dll!nsWindow::OnChar(unsigned int mbcsCharCode=15, unsigned int
virtualKeyCode=0, bool isMultiByte=false)  Line 3165	C++
 	gkwidget.dll!nsWindow::ProcessMessage(unsigned int msg=258, unsigned int
wParam=15, long lParam=1572865, long * aRetValue=0x0012f77c)  Line 3880 + 0x22	C++
 	gkwidget.dll!nsWindow::WindowProc(HWND__ * hWnd=0x001f0218, unsigned int
msg=258, unsigned int wParam=15, long lParam=1572865)  Line 1349 + 0x1b	C++


Reproducible: Always

Steps to Reproduce:
Assignee: bugs → general
Status: UNCONFIRMED → NEW
Component: File Handling → DOM: Mozilla Extensions
Ever confirmed: true
Product: Firefox → Core
QA Contact: aebrahim-bmo → ian
Version: unspecified → Trunk
Attached patch PatchSplinter Review
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #179726 - Flags: superreview?(jst)
Attachment #179726 - Flags: review?(jst)
Severity: normal → critical
Keywords: crash
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → DEC
Summary: accessing responseText on a XMLHttpRequest Object crashes when mimetype is set to gzip → [FIX]accessing responseText on a XMLHttpRequest Object crashes when mimetype is set to gzip
Target Milestone: --- → mozilla1.8beta2
I'm not set up to test the patch, but I believe 
http://jibbering.com/2005/4/mozillaBug.Crash.html is also caused by this issue, 
I won't raise another bug now.
Comment on attachment 179726 [details] [diff] [review]
Patch

r+sr=jst
Attachment #179726 - Flags: superreview?(jst)
Attachment #179726 - Flags: superreview+
Attachment #179726 - Flags: review?(jst)
Attachment #179726 - Flags: review+
Comment on attachment 179726 [details] [diff] [review]
Patch

Requesting approval for a simple null-check crash fix
Attachment #179726 - Flags: approval1.8b2?
Summary: [FIX]accessing responseText on a XMLHttpRequest Object crashes when mimetype is set to gzip → [FIXr]accessing responseText on a XMLHttpRequest Object crashes when mimetype is set to gzip
Comment on attachment 179726 [details] [diff] [review]
Patch

a=chofmann
Attachment #179726 - Flags: approval1.8b2? → approval1.8b2+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: