View Issue Details

IDProjectCategoryView StatusLast Update
0028497CommunityOCCT:Modeling Datapublic2017-03-01 23:13
Reporterabdullah Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionno change required 
PlatformFreeCAD Ubuntu 6.8.0.oce-0.17OSUbuntu 
Product Version6.8.0 
Summary0028497: Crash in Geom_BSplineCurve::ValidateCache inside the call of BSplCLib::BuildCache
DescriptionThis crashes on the OCE 6.8.0-0.17 we use in FreeCAD's Ubuntu repository.

It additionally crashes on OCE 0.13 in Windows.

It does not crash on OCC 7.0.

See code for reproducing this crash below.

The crash:

Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x36cb0) [0x7f4b933bbcb0]
0000001 0x7f4b0300ea14 in BSplCLib::BuildCache(double, double, bool, int, TColStd_Array1OfReal const&, TColgp_Array1OfPnt const&, TColStd_Array1OfReal const&, TColgp_Array1OfPnt&, TColStd_Array1OfReal&) from /usr/lib/x86_64-linux-gnu/libTKMath.so.10+0x484
0000002 0x7f4b033f9582 in Geom_BSplineCurve::ValidateCache(double) from /usr/lib/x86_64-linux-gnu/libTKG3d.so.10+0x202
#3 0x7f4b033f2a7e in Geom_BSplineCurve::D0(double, gp_Pnt&) const from /usr/lib/x86_64-linux-gnu/libTKG3d.so.10+0xde
#4 0x7f4b033de1b5 in Geom_Curve::Value(double) const from /usr/lib/x86_64-linux-gnu/libTKG3d.so.10+0x25
#5 0x7f4b03423d73 in GeomLProp_CurveTool::Value(Handle_Geom_Curve const&, double, gp_Pnt&) from /usr/lib/x86_64-linux-gnu/libTKG3d.so.10+0x13
#6 0x7f4b03427175 in GeomLProp_CLProps::SetParameter(double) from /usr/lib/x86_64-linux-gnu/libTKG3d.so.10+0x75
0000007 0x7f4b0342727d in GeomLProp_CLProps::GeomLProp_CLProps(Handle_Geom_Curve const&, double, int, double) from /usr/lib/x86_64-linux-gnu/libTKG3d.so.10+0xcd
Steps To ReproduceCode:

#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <GeomLProp_CLProps.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Precision.hxx>

int main()
{
    TColgp_Array1OfPnt poles(1,6);
    poles(1) = gp_Pnt(537.277,-284.089,0.0);
    poles(2) = gp_Pnt(575.138,-218.104,0.0);
    poles(3) = gp_Pnt(636.797,-282.468,0.0);
    poles(4) = gp_Pnt(664.38,-217.56,0.0);
    poles(5) = gp_Pnt(721.71,-280.84,0.0);
    poles(6) = gp_Pnt(759.57,-214.31,0.0);
   
    TColStd_Array1OfReal weights(1,6);
    weights(1) = 1.0;
    weights(2) = 1.0;
    weights(3) = 1.0;
    weights(4) = 1.0;
    weights(5) = 1.0;
    weights(6) = 1.0;
   
    TColStd_Array1OfReal weights2(1,7);
    weights2(1) = 12.99;
    weights2(2) = 12.99;
    weights2(3) = 12.99;
    weights2(4) = 12.99;
    weights2(5) = 1.0;
    weights2(6) = 12.99;
    weights2(7) = 12.99;
   
    TColStd_Array1OfReal knots(1,4);
    knots(1) = 0.0;
    knots(2) = 0.33333333333;
    knots(3) = 0.66666666666;
    knots(4) = 1.0;
   
    TColStd_Array1OfInteger mults(1,4);
    mults(1) = 4;
    mults(2) = 1;
    mults(3) = 1;
    mults(4) = 4;
   
    Geom_BSplineCurve * mybsp = new Geom_BSplineCurve(poles, weights, knots, mults, 3, false, true);
   
    mybsp->IncreaseMultiplicity(2,2);
   
    TColgp_Array1OfPnt poles2(1,mybsp->NbPoles());
    mybsp->Poles(poles2);
   
    //TColStd_Array1OfReal weights2(1,mybsp->NbPoles());
    //mybsp->Weights(weights2);
   
    TColStd_Array1OfReal knots2(1,mybsp->NbKnots());
    mybsp->Knots(knots2);
   
    TColStd_Array1OfInteger mults2(1,mybsp->NbKnots());
    mybsp->Multiplicities(mults2);
   
   
    for (Standard_Integer it = 1; it <= poles.Length(); it++) {
        mybsp->SetPole(it, poles2(it), weights2(it));
    }
   
    for (Standard_Integer it = 1; it <= knots.Length(); it++) {
        mybsp->SetKnot(it, knots2(it), mults2(it));
    }
   
    Standard_Real k2 = mybsp->Knot(1);
   
    GeomLProp_CLProps prop(mybsp,k2,0,Precision::Confusion());
   
    const gp_Pnt &point=prop.Value();

    return 0;
}

Built in Ubuntu using:

g++ main.cpp -I/usr/include/oce -L/usr/lib/x86_64-linux-gnu -lTKG3d -lTKernel -o spline
Additional information
and documentation updates
FreeCAD posts:
https://forum.freecadweb.org/viewtopic.php?f=10&t=9364&start=330#p162528
https://forum.freecadweb.org/viewtopic.php?f=10&t=9364&start=330#p162452
TagsNo tags attached.
Test case number

Activities

msv

2017-03-01 17:35

developer   ~0064061

If the bug is not actual for dev version I propose to close it.

abdullah

2017-03-01 23:11

reporter   ~0064067

In principle it is ok with the current version. We think it may have been fixed in 6.9.

Thanks for your time.

You may close the ticket.

Issue History

Date Modified Username Field Change
2017-03-01 16:07 abdullah New Issue
2017-03-01 16:07 abdullah Assigned To => msv
2017-03-01 17:35 msv Note Added: 0064061
2017-03-01 17:35 msv Assigned To msv => bugmaster
2017-03-01 17:35 msv Status new => feedback
2017-03-01 17:35 msv Resolution open => no change required
2017-03-01 17:35 msv Description Updated
2017-03-01 17:35 msv Steps to Reproduce Updated
2017-03-01 17:35 msv Additional Information Updated
2017-03-01 23:11 abdullah Note Added: 0064067
2017-03-01 23:13 abv Status feedback => closed