Infinite loop in GCPnts_TangentialDeflection::PerformCurve<Adaptor3d_Curve>(const Adaptor3d_Curve & theC)

I using OCC 7.9.2 in a development version of FreeCAD 1.1 and when importing a STEP file the code goes into an infinite loop in GCPnts_TangentialDeflection::PerformCurve<Adaptor3d_Curve>(const Adaptor3d_Curve & theC)

Looking at the code you can see the code has a loop
while (MorePoints)
{
// do stuff
}

MorePoints never gets set to FALSE

The problem seems to be this block
if (Abs(myLastU - U2) < myUTol)
{
myParameters.Append(myLastU);
myPoints.Append(LastPoint);
MorePoints = Standard_False;
Correction = Standard_False;
}
myUTol is 1.0e-9

while the values of myLastU are for example are 28504645528747.234

So the test is never going to be met due to roundoff errors.

My point is, I guess, that even if the data here is bad for some reason, this loop always has the potential to never exit, there should be some more defensive programming in this function

Dmitrii Pasukhin's picture

Hello.

Please provide file and code sample to reproduce. Also, can you report bug to GitHub: https://github.com/Open-Cascade-SAS/OCCT/issues

Forum's reports are not registered to be fixed.

Best regards, Dmitrii.