New issue
Advanced search Search tips

Issue 905520 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Enable DHECK's in media encode/decode unittests

Project Member Reported by dstaessens@google.com, Nov 15

Issue description

Media encode/decode tests are broken in debug on a regular basis. This is caused by only running testcases in release, which don't have DCHECK's enabled. This means that errors might be introduced and only caught after a long time, making DCHECK's almost useless.

To fix this, we would like to build unittests with the 'DCHECK_ALWAYS_ON' flag.

Some things need to be considered carefully though:
- Will this increase the build times?
- What will be the effect on performance? Should we have a binaries without DCHECK's for performance testing?

 
Cc: steve...@chromium.org
Steven, Mike, any idea how we can add 'DCHECK_ALWAYS_ON' to the test binaries that end up on the device?

such as:
jpeg_decode_accelerator_unittest
jpeg_encode_accelerator_unittest
video_decode_accelerator_unittest
video_encode_accelerator_unittest

Cc: ihf@chromium.org
I guess we'd have to run gn gen (https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/chromeos-chrome/chromeos-chrome-9999.ebuild#981) twice, once with dcheck_always_on=true, and once false.

For the former, we'd have to run chrome_make (https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/chromeos-chrome/chromeos-chrome-9999.ebuild#1054) with chrome_targets only containing the above unittest binaries, and for the latter the rest of targets, including main chrome target.

Deploying should work in the same way/should not require changes (the binaries would still be in out/Release).

This means we'd have to compile (but not link) twice. For performance, my guess would be that dchecks' impact should be negligible.

It may also be interesting to run all unittests with this, not only video ones.

Cc: bpastene@chromium.org
+bpastene@

Labels: OS-Chrome
The problem with the DCHECK is that it will terminate the test run and it won't detect any more failures after that. So on its own it is great at making itself obsolete. A better way would be to fail the test in which the DCHECK happened - with a meaningful log message - and continue testing all following test cases.
It does indeed seem to abort the full run, rather than a single testcase.

I would argue though that it's still useful. I'dd rather miss some test results, than having a potential dangerous bug slip through. In this case we found a failing DCHECK that had gone unnoticed for quite some time, and was actually pointing at a memory leak.

Usually these failures would be caught by pre-submit checks, in which case it's acceptable to abort the test run. Hopefully this will remind programmers to always run tests in debug before checking in.

It might be tricky to just make a DCHECK fail the tests, as we want a full stackdump etc.
Status: Assigned (was: Untriaged)
GPU Triage: Marking assigned as this appears to have an owner.
Components: -Internals>GPU>Video OS>Kernel>Video

Sign in to add a comment