Last Comment Bug 746810 - ASSERTION: Target channel not in the process of opening: 'ChannelOpening == aTargetChan->mChannelState
: ASSERTION: Target channel not in the process of opening: 'ChannelOpening == a...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: IPC (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: mozilla14
Assigned To: Oleg Romashin (:romaxa)
:
Mentors:
Depends on:
Blocks: 746800
  Show dependency treegraph
 
Reported: 2012-04-18 17:12 PDT by Oleg Romashin (:romaxa)
Modified: 2012-04-25 04:15 PDT (History)
3 users (show)
ryanvm: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix proposal (1.03 KB, patch)
2012-04-18 17:12 PDT, Oleg Romashin (:romaxa)
cjones.bugs: review+
cjones.bugs: feedback+
mark.finkle: approval‑mozilla‑central+
Details | Diff | Splinter Review

Description Oleg Romashin (:romaxa) 2012-04-18 17:12:20 PDT
Created attachment 616364 [details] [diff] [review]
Fix proposal

On attempt to initialize Compositor Parent channel for OMTC rendering in embedding setup: see bug 746800#c1
I see next assertion:
**************************************
1034701888[3dc647f0]: ###!!! ASSERTION: Target channel not in the process of opening: 'ChannelOpening == aTargetChan->mChannelState', file ipc/glue/AsyncChannel.cpp, line 368
###!!! ASSERTION: Target channel not in the process of opening: 'ChannelOpening == aTargetChan->mChannelState', file ipc/glue/AsyncChannel.cpp, line 368
1034701888[3dc647f0]: ###!!! ASSERTION: Target channel not in the process of opening: 'ChannelOpening == aTargetChan->mChannelState', file ipc/glue/AsyncChannel.cpp, line 375
###!!! ASSERTION: Target channel not in the process of opening: 'ChannelOpening == aTargetChan->mChannelState', file ipc/glue/AsyncChannel.cpp, line 375
**********************************
which is coming right after PostTask(NewRunnableMethod(aTargetChan, &AsyncChannel::OnOpenAsSlave,)
http://mxr.mozilla.org/mozilla-central/source/ipc/glue/AsyncChannel.cpp#342

it looks like AsyncChannel::OnOpenAsSlave executed in child thread 
before mChannelState = ChannelOpening set

Moving mChannelState = ChannelOpening before PostTask call, fixing the problem
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-19 11:32:03 PDT
Comment on attachment 616364 [details] [diff] [review]
Fix proposal

This makes sense.  I was able to reproduce the assertion when running the ipdl/c++ tests, |make -C $objdir/ipc/ipdl/test/cxx check|.  Please test your patch against those tests and all good.

Thanks!
Comment 2 Oleg Romashin (:romaxa) 2012-04-20 11:25:53 PDT
Comment on attachment 616364 [details] [diff] [review]
Fix proposal

Tested this with make check
Cannot catch that locally on desktop gtk debug build (probably different timings)
Test same with patch and don't see any new errors.
Comment 3 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-20 14:24:40 PDT
This code runs in native-fennec, and fixes a race condition/logic error that native-fennec is vulnerable to hit.  If there are debug builds of native-fennec it's quite likely they were tripping this assertion.

The fix itself has basically no risk.  I'm not sure if the defect it fixes could cause user-visible issues, but it's possible.
Comment 4 Oleg Romashin (:romaxa) 2012-04-20 14:48:40 PDT
https://tbpl.mozilla.org/?tree=Try&rev=55d3402d5186
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-04-21 14:37:08 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/8ef46e071f65

Any chance of getting a test for this?
Comment 6 Oleg Romashin (:romaxa) 2012-04-21 14:41:25 PDT
not sure, this is timing dependent issue.. depends on how fast thread could be created
Comment 7 Phil Ringnalda (:philor) 2012-04-21 23:26:57 PDT
https://hg.mozilla.org/mozilla-central/rev/8ef46e071f65
Comment 8 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-25 04:15:14 PDT
This is caught by existing tests.  They don't run on tinderbox though.

Note You need to log in before you can comment on or make changes to this bug.