<html><head><style data-externalstyle="true">
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
</style></head><body><div data-externalstyle="false" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:16px;"><div>There’s already this code:</div><div> if (size == NULL)<br> {<br> return;<br> }<br></div><div>Why not just add another similar block?</div><div data-focusfrompointer="true"> if (size[0] == 0 && size[1] == 0)</div><div data-focusfrompointer="true"><div data-focusfrompointer="true"> {<br> return;<br> }<br></div></div><div data-signatureblock="true">I bet all of those tests that assert go through that same code again later after the window really does have a size, and the correct result is used way after this “failure” is presently occurring...</div><div data-signatureblock="true"> </div><div data-signatureblock="true"> </div><div data-signatureblock="true">D</div><div data-signatureblock="true"> </div><div data-signatureblock="true"> </div> <div style="border-top-color: rgb(225, 225, 225); border-top-width: 1px; border-top-style: solid;"> <strong>From:</strong> Sean McBride<br> <strong>Sent:</strong> March 20, 2013 5:04 PM<br> <strong>To:</strong> vtk-developers@vtk.org<br> <strong>Subject:</strong> [vtk-developers] Help with vtkLineRepresentationTest1 test<br> </div> <div> </div>Hi all,<br><br>The test 'vtkInteractionWidgetsCxx-vtkLineRepresentationTest1' divides by 0, thus creating a (double) NaN, which it then later tries to convert to float, which is undefined behaviour[1].<br><br>The divide-by-zero happens in vtkViewport::DisplayToView() because size[0] and size[1] are zero, which I'm thinking they probably shouldn't be. Backtrace:<br><br>#0 vtkViewport::DisplayToView (this=0x10ff51fc0) at VTK/Rendering/Core/vtkViewport.cxx:209<br>#1 vtkViewport::DisplayToWorld (this=0x10ff51fc0) at vtkViewport.h:169<br>#2 vtkInteractorObserver::ComputeDisplayToWorld (ren=0x10ff51fc0, x=-2.5, y=-2.5, z=0.99000990000000011, worldPt=0x7fff5fbfba40) at VTK/Rendering/Core/vtkInteractorObserver.cxx:268<br>#3 vtkWidgetRepresentation::SizeHandlesInPixels (this=0x10ff21900, factor=1.3500000000000001, pos=0x10ff37a98) at VTK/Interaction/Widgets/vtkWidgetRepresentation.cxx:194<br>#4 vtkLineRepresentation::SizeHandles (this=0x10ff21900) at VTK/Interaction/Widgets/vtkLineRepresentation.cxx:673<br>#5 vtkLineRepresentation::BuildRepresentation (this=0x10ff21900) at VTK/Interaction/Widgets/vtkLineRepresentation.cxx:738<br>#6 vtkLineRepresentationTest1 () at VTK/Interaction/Widgets/Testing/Cxx/vtkLineRepresentationTest1.cxx:21<br>#7 main (ac=7, av=0x7fff5fbff7b0) at VTK-big-bin/Interaction/Widgets/Testing/Cxx/CxxTests.cxx:587<br><br>You can easily reproduce this with any compiler if you add:<br><br> assert(sizex > 0);<br> assert(sizey > 0);<br><br>to vtkViewport::DisplayToView(). In fact doing so results in 6 different tests asserting.<br><br>I don't know how to address this... any thoughts?<br><br>[1] or at least sorta undefined:<br><http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-March/028596.html><br><br>Thanks,<br><br>-- <br>____________________________________________________________<br>Sean McBride, B. Eng sean@rogue-research.com<br>Rogue Research www.rogue-research.com <br>Mac Software Developer Montréal, Québec, Canada<br><br><br>_______________________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.vtk.org/mailman/listinfo/vtk-developers<br><br></div></body></html>