Closed Bug 1209446 Opened 4 years ago Closed 4 years ago

CompositorOGL::mFrameInProgress not reset properly when early leaving ::BeginFrame


(Core :: Graphics, defect)

Not set



Tracking Status
firefox44 --- fixed


(Reporter: tworaz666, Assigned: tworaz666)



(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20150925195032

Steps to reproduce:

In case the rect object in CompositorOGL::BeginFrame is empty the function lives almost immediately. Unfortunately it does not reset the mFrameInProgress flag to false. As a result when such situation happens in debug builds the code will terminate due to an assertion failure in the next ::BeginFrame call.

Actual results:

Gecko terminated due to a failing assertion MOZ_ASSERT(!mFrameInProgress, "frame still in progress (should have called EndFrame");.

Expected results:

The assert should not fail.
Attachment #8667187 - Flags: review?(vladimir)
Keywords: checkin-needed
Comment on attachment 8667187 [details] [diff] [review]

Better yet -- move the mFrameInProgress = true setting to below this block, with a comment saying something like "We're about to actually draw a frame".

This mFrameInProgress stuff seems odd -- shouldn't EndFrame also check that there's a frame actually in progress, and if not, early return?  Poking :nical (he knows the OGL compositor best these days)...
Attachment #8667187 - Flags: feedback?(nical.bugzilla)
Attachment #8667187 - Attachment is obsolete: true
Attachment #8667187 - Flags: review?(vladimir)
Attachment #8667187 - Flags: feedback?(nical.bugzilla)
Attachment #8667328 - Flags: review?(nical.bugzilla)
Comment on attachment 8667328 [details] [diff] [review]

Review of attachment 8667328 [details] [diff] [review]:

This is a slight improvement and a very simple patch, so r+ but I'd like to go further (as a followup if you want) because I feel uneasy about having the the requirement that EndFrame is called if and only if BeginFrame succeeded with no way for the caller to know if BeginFrame succeeded.
We should either enforce that if one calls BeginFrame then it has to call EndFrame, or have BeginFrame return a boolean and enforce that EndFrame is called if and only if BeginFrame returned true.

Piotr, do you want to make a patch for this? Also, please update your mercurial config following the instructions here so that your patches have the right formatting.
Attachment #8667328 - Flags: review?(nical.bugzilla) → review+
Assignee: nobody → tworaz666
Thanks for the review Nicolas. I'm afraid I won't have the time in the next couple of days at least, to make sure EndFrame is always called.

Unfortunately I'm using git, not mercurial. The company I currently work for uses EmbedLite gecko port for their browser. Since EmbedLite is using git it's easier to take git patches and convert them to hg. Such workflow seems to be at least partially supported by mozilla, see: The problem with the commit message is in the fact that it uses dash instead double colon to separate bug number from the commit description, right?
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.