Closed Bug 1544777 Opened 6 years ago Closed 5 years ago

[socket process] Assertion failure: mOnStartRequestCalled (OnStartRequest should be called before OnStopRequest)

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: kershaw, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 obsolete file)

I've noticed this assertion when running this test [1].
Here are the steps for causing this assertion.

  1. A sync XHR is created in OnStartRequest at [2].
  2. Since it's a sync XHR, SpinEventLoopUntil is called here [3].
  3. We never have a chance to set mOnStartRequestCalled to true at [4].
  4. nsHttpChannel::OnStopRequest is called since HttpTransactionParent receives the IPC from socket process.

[1] https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/netwerk/test/unit/test_reentrancy.js
[2] https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/netwerk/test/unit/test_reentrancy.js#51
[3] https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/dom/xhr/XMLHttpRequestMainThread.cpp#2910
[4] https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/netwerk/protocol/http/nsHttpChannel.cpp#1829

can you explain why is it working without the socket process?

Flags: needinfo?(kershaw)

(In reply to Dragana Damjanovic [:dragana] from comment #2)

can you explain why is it working without the socket process?

Because OnStartRequest is called at [1]. The |nsInputStreamPump::mState| is always STATE_START until |mListener->OnStartRequest| returns. This means that ODA and OnStopRequest will not called.

When socket process is enabled, RecvOnDataAvailable and RecvOnStopRequest are actually events dispatched from IPC thread and could be executed from [2].

[1] https://searchfox.org/mozilla-central/rev/d33d470140ce3f9426af523eaa8ecfa83476c806/netwerk/base/nsInputStreamPump.cpp#487
[2] https://searchfox.org/mozilla-central/rev/d33d470140ce3f9426af523eaa8ecfa83476c806/xpcom/threads/nsThreadUtils.h#348

Flags: needinfo?(kershaw)
Priority: -- → P2
Whiteboard: [necko-triaged]
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Attachment #9058630 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: