Closed Bug 552014 Opened 14 years ago Closed 14 years ago

IPDL: The OnMaybeDequeueOne task shouldn't run in a nested (wrt RPC) context

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- .4-fixed

People

(Reporter: cjones, Assigned: cjones)

References

Details

(Whiteboard: [fixed-lorentz])

Attachments

(3 files, 1 obsolete file)

Otherwise we can dequeue tasks at inopportune times.  For example:

  A                      B
 ------------           -----------
  spin                   send async A()
  [enqueue Dequeue()]
  CallFoo()
  [wait]
  dequeue A
  [wait]                 send async B()
  dequeue B              reply to Foo()
  do stuff
  spin nested loop
  Dequeue() runs
  Incall(replyToFoo)
  abort()
I should add that by "nested (wrt RPC)" I meant that it's actually OK (wrt RPC) if this tasks runs in a nested context, there just can't be other RPC code on the stack when it runs.
Attached patch Test (obsolete) — Splinter Review
Yay?

 (sleeping to wait for nonce ... sorry)
 (sleeping to wait for reply to R ... sorry)
###!!! [RPCChannel][Parent][/home/cjones/mozilla/mozilla-central/ipc/glue/RPCChannel.cpp:410] Assertion (call.is_rpc() && !call.is_reply()) failed.  wrong message type (triggered by rpc)
  RPCChannel 'backtrace':
  [(0) out async PTestNestedLoops::Msg_R(actor=32545) ]
  [(1) in async PTestNestedLoops::Msg_Nonce(actor=2147483647) ]
  [(2) in rpc ???(actor=2147483647) ]
  remote RPC stack guess: 0
  deferred stack size: 0
  out-of-turn RPC replies stack size: 0
  Pending queue size: 0, front to back:
###!!! ABORT: wrong message type: file /home/cjones/mozilla/mozilla-central/ipc/glue/RPCChannel.cpp, line 625
Trace/breakpoint trap
Assignee: nobody → jones.chris.g
(sleeping to wait for nonce ... sorry)
 (sleeping to wait for reply to R ... sorry)
NOTE: child process received `Goodbye', closing down
TEST-PASS | TestNestedLoops | ok

Also passes ipdl/cxx and mochitest-ipcplugins.
Attachment #432235 - Flags: review?(bent.mozilla)
Comment on attachment 432235 [details] [diff] [review]
Don't run OnMaybeDequeueOne from a nested context

>+        // bail here, but ensure that each at exit point

"at each exit point"
Attachment #432235 - Flags: review?(bent.mozilla) → review+
(In reply to comment #2)
>   RPCChannel 'backtrace':
>   [(0) out async PTestNestedLoops::Msg_R(actor=32545) ]
>   [(1) in async PTestNestedLoops::Msg_Nonce(actor=2147483647) ]
>   [(2) in rpc ???(actor=2147483647) ]

Oh crap ... this is the wrong stack.  I think I know what the problem is, will try to fix in bug 533055.
Attached patch TestSplinter Review
Now with hg add.
Attachment #432232 - Attachment is obsolete: true
Jim reports that this majorly regressed video perf on windows because we stop processing messages in nested event loops.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 433507 [details] [diff] [review]
Treat RPC replies received in an event loop nested inside the one from which the call was made as if they had arrived out of order

http://hg.mozilla.org/mozilla-central/rev/a135d2f38e1c
Attachment #433507 - Flags: review?(jmathies) → review+
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Blanket approval for Lorentz merge to mozilla-1.9.2
a=beltzner for 1.9.2.4 - please make sure to mark status1.9.2:.4-fixed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: