New issue
Advanced search Search tips

Issue 918734 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 3
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

gfx::ClockwiseAngleBetweenVectorsInDegrees can return NAN

Project Member Reported by bsheedy@chromium.org, Jan 3

Issue description

gfx::ClockwiseAngleBetweenVectorsInDegrees can return NAN in cases where the two provided vectors are extremely close. This is likely due to trying to take the arccosine of something that's slightly outside of [-1, 1] due to floating point precision.

This was originally found in VR Browser instrumentation tests on Vega devices, but is easily reproducible in the GFX unittests using the following vectors:

(0, -0.990842f, -0.003177f)
(0, -0.999995f, -0.003124f)
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4f2d56697612f4ffb9753b27d74c2dedf7451633

commit 4f2d56697612f4ffb9753b27d74c2dedf7451633
Author: bsheedy <bsheedy@chromium.org>
Date: Thu Jan 03 22:16:07 2019

Fix AngleBetweenVectorsInDegrees NAN

Fixes potential NANs from gfx::AngleBetweenVectorsInDegrees and
gfx::ClockwiseAngleBetweenVectorsInDegrees when the given vectors are
very close together by clamping the value passed to acos. When
unclamped, the value passed to acos could be slightly outside [-1, 1]
due to floating point precision.

Bug:  918734 
Change-Id: I55b75b21581d25134fdc3e8e6db80892607a807c
Reviewed-on: https://chromium-review.googlesource.com/c/1394086
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619780}
[modify] https://crrev.com/4f2d56697612f4ffb9753b27d74c2dedf7451633/ui/gfx/geometry/vector3d_f.cc
[modify] https://crrev.com/4f2d56697612f4ffb9753b27d74c2dedf7451633/ui/gfx/geometry/vector3d_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment