Closed Bug 388523 Opened 17 years ago Closed 17 years ago

###!!! ASSERTION: null request in stream complete handler: 'request', file nsScriptLoader.cpp, line 791

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha8

People

(Reporter: MatsPalmgren_bugz, Assigned: Biesinger)

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

STEPS TO REPRODUCE
see bug 380512

ACTUAL RESULTS
###!!! ASSERTION: null request in stream complete handler: 'request', file nsScriptLoader.cpp, line 791
So this is an HTTP bug, I think.  The problem is that nsHttpChannel::OnStartRequest poses the auth dialog.  While this dialog is up, the underlying nsInputStreamPump is canceled with NS_BINDING_ABORTED.  The user selects "OK" in the dialog, so HTTP needs to do an auth retry.  It does NOT call OnStartRequest on its listener, and returns from nsHttpChannel::OnStartRequest.

Now in nsInputStreamPump::OnStateStart we have mStatus == NS_BINDING_ABORTED, so the stream pump's loop in OnInputStreamReady calls OnStateStop, which calls nsHttpChannel::OnStopRequest.  The HTTP channel passes this stop through to its listener... but the listener never got an OnStartRequest.  In this case, the listener stores some state in OnStartRequest to use in OnStopRequest, so things don't work out.

We can fix this by checking mCanceled after calling GetCredentials() or calling ProcessAuthentication(), but should we instead just make sure we call OnStartRequest in nsHttpChannel::OnStopRequest if we haven't called it yet?  Seems more robust.
Flags: blocking1.9?
Assignee: nobody → cbiesinger
Flags: blocking1.9? → blocking1.9+
Attached patch patchSplinter Review
Attachment #275530 - Flags: superreview?(bzbarsky)
Attachment #275530 - Flags: review?(bzbarsky)
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → mozilla1.9 M8
Comment on attachment 275530 [details] [diff] [review]
patch

Makes sense.
Attachment #275530 - Flags: superreview?(bzbarsky)
Attachment #275530 - Flags: superreview+
Attachment #275530 - Flags: review?(bzbarsky)
Attachment #275530 - Flags: review+
Checking in nsHttpChannel.cpp;
/cvsroot/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp,v  <--  nsHttpChannel.cpp
new revision: 1.316; previous revision: 1.315
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: