Closed Bug 1036657 Opened 10 years ago Closed 10 years ago

"Assertion failure: intercept.HasPositiveWCoord()"

Categories

(Core :: Graphics, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: jruderman, Assigned: bjacob)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Attached file testcase
Assertion failure: intercept.HasPositiveWCoord(), at gfx/thebes/gfx3DMatrix.cpp:821

This assertion was just added, in bug 1031948.
Attached file stack
My bad for not catching this during review.

I can reproduce; intercept.w is NaN.

That is because the points that we are working on have 'inf' coordinates in this testcase. Even if they hadn't, in ComputePerspectivePlaneIntercept we do:

  float w = 0.00001f;
  float t = (w - aFirst.w) / (aSecond.w - aFirst.w);

  // Use t to find the remainder of the components
  return aFirst + (aSecond - aFirst) * t;

So we could easily end up with NaN if the computation of t were a 0/0 division.

Finally, that assertion could also fail if loss of precision caused w to be exactly zero.

All in all, I think that that assertion is bad and needs to be removed.

Note that MOZ_ASSERT already prevents people from accidentally writing assertions on floating-point values being nonzero (MOZ_ASSERT(x)) as those are most often bad assertions. But here we are not in a trivial case that MOZ_ASSERT's static checking can catch for us.
Attachment #8458845 - Flags: review?(matt.woodrow)
Attachment #8458845 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/9d4a18a375d0
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: