New issue
Advanced search Search tips

Issue 911689 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

adhd unit test failing in ubsan builder

Project Member Reported by manojgupta@chromium.org, Dec 4

Issue description

https://cros-goldeneye.corp.google.com/chromeos/healthmonitoring/buildDetails?buildbucketId=8928074746337446368

adhd-0.0.1-r1607:  * ASAN error detected:
adhd-0.0.1-r1607:  * tests/mix_unittest.cc:414:33: runtime error: left shift of negative value -2105343
adhd-0.0.1-r1607:  *     #0 0x55aa867d650d in (anonymous namespace)::MixTestSuiteS24_LE::Scale(int, float) /build/amd64-generic/tmp/portage/media-sound/adhd-0.0.1-r1607/work/adhd-0.0.1/cras/src/tests/mix_unittest.cc:414:33
adhd-0.0.1-r1607:  *     #1 0x55aa867d650d in (anonymous namespace)::MixTestSuiteS24_LE::ScaleIncrement(float, float, float) /build/amd64-generic/tmp/portage/media-sound/adhd-0.0.1-r1607/work/adhd-0.0.1/cras/src/tests/mix_unittest.cc:404
adhd-0.0.1-r1607: 
adhd-0.0.1-r1607: >>> Failed to emerge media-sound/adhd-0.0.1-r1607 for /build/amd64-generic/, Log file:


To repro:
FEATURES=test USE=ubsan emerge-amd64-generic adhd
 
Labels: M-73
Owner: tzungbi@chromium.org
S24 change related it looks like.
tzungbi@ This is also blocking other packages unit tests from running, ptal.
Status: Started (was: Untriaged)
The error messages are:
server/cras_mix_ops.c:233:28: runtime error: left shift of negative
value -2105343
tests/mix_unittest.cc:414:33: runtime error: left shift of negative
value -2105343
For the left shift op, using unsigned type instead of signed type might be enough to silence the complains.
Got it.

The CL is going to merge.  https://chromium-review.googlesource.com/1362263
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/3981d3f014659719c93b4059397a758034501c13

commit 3981d3f014659719c93b4059397a758034501c13
Author: Tzung-Bi Shih <tzungbi@chromium.org>
Date: Wed Dec 05 12:22:27 2018

CRAS: mix: remove undefined behaviors around shift

The error messages are:
server/cras_mix_ops.c:233:28: runtime error: left shift of negative
value -2105343
tests/mix_unittest.cc:414:33: runtime error: left shift of negative
value -2105343

Add casts and bitwise AND to make ubsan happy.

BUG= chromium:911689 
TEST=FEATURES=test USE=ubsan emerge-atlas adhd
Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org>
Change-Id: I7e00195c40c9d61989a4061dbe9cbae420a3d895
Reviewed-on: https://chromium-review.googlesource.com/1362263
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>

[modify] https://crrev.com/3981d3f014659719c93b4059397a758034501c13/cras/src/tests/mix_unittest.cc
[modify] https://crrev.com/3981d3f014659719c93b4059397a758034501c13/cras/src/server/cras_mix_ops.c

Status: Fixed (was: Started)

Sign in to add a comment