My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2820: Fixes race condition issue in CTS test testVirtualDisplayRecycles
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Aug 2014


Sign in to add a comment
 
Reported by oleksiy....@gmail.com, Aug 8, 2014
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version: Android CTS 4.4_r3

Fixes race condition issue in test testVirtualDisplayRecycles.

Patch changes the following:
1. Fixes race condition issue in CTS test testVirtualDisplayRecycles.
Issue leads to assert (fail("should not happen")) in the function
updateTexImageIfNecessary.
2. Fixes condition for assert (fail("should not happen")).
Original implementation skips the first error case and triggers.
test fail starting from the second only.

Interesting flow fragment is next:
  Block1
  inside function onFrameAvailable:
  - counter mNumTextureUpdated is incremented (w.markTextureUpdated();)
  - message is sent to start rendering (requestUpdate();)
  - message is pushed in queue associated with current thread
  ...
  Block2
  - message is poped from queue associated with current thread
  - message is handled (CompositionHandler::handleMessage)
    as result is invoked doGlRendering() ---> mTopWindow.updateTexImageIfNecessary();
    inside updateTexImageIfNecessary is performed:
    - counter mNumTextureUpdated is post decremented
    - input counter value is verified and triggers test fail on counter underrun

NOTE: counter mNumTextureUpdated is member of object GlWindow.

Problem happens when GlWindow instance (and counter mNumTextureUpdated correspondingly)
is destroed and created new one beetween Block1 and Block2 (due to test logic) and.
counter value is always equal to 0 (function GlWindow::cleanup()).

The issue happens on regular basis but because of assert condition skips the
first error case and triggers test fail starting from the second only actual test
fail happens time to time.

Solution: 1. Message "tail" removal when new GlWindow object is created (inside.
          GlWindow::cleanup()).
          2. Additionaly there was fixed assert condition to catch the first.
          error case as well (function updateTexImageIfNecessary)
          ...
          if (numTextureUpdated <= 0) {
            fail("should not happen");
          }
          ...
          instead of
          ...
          if (numTextureUpdated < 0) {
            fail("should not happen");
          }
          ...

0001-Fixes-race-condition-issue-in-test-testVirtualDispla.patch
3.7 KB   Download
Aug 15, 2014
Project Member #1 huga...@gmail.com
Wrong issue tracker. This issue tracker is about the Gerrit Code Review Project and your issue is not related to Gerrit.
Status: Invalid
Sign in to add a comment

Powered by Google Project Hosting