MantisBT - Community
View Issue Details
0022690Community[OCCT] OCCT:Modeling Algorithmspublic2011-08-01 11:392012-04-02 18:04
atp 
abv 
normalminor 
closedfixed 
 
[OCCT] 6.5.3[OCCT] 6.5.3 
0022690: Access violations in BRepLib.cxx
Reported by Markus Rhein in thread http://www.opencascade.org/org/forum/thread_21269/ [^]

I have some access violations due to corrupt/uninitialized? geometry objects in BRepLib.cxx during (XDE) STEP import (Win64Bit, OCC 6.3.1-6.5.1, default import parameters). Unfortunately, I cannot share the STEP file causing this.
The related code is in BRepLib.cxx starting from line 1508:

Handle(BRepAdaptor_HCurve2d) HC2d1 = new BRepAdaptor_HCurve2d();
HC2d1->ChangeCurve2d().Initialize(E,F1);
if(couture) E.Orientation(TopAbs_REVERSED);
Handle(BRepAdaptor_HCurve2d) HC2d2 = new BRepAdaptor_HCurve2d();
HC2d2->ChangeCurve2d().Initialize(E,F2);

Adaptor3d_CurveOnSurface C1(HC2d1,HS1);
Adaptor3d_CurveOnSurface C2(HC2d2,HS2);

The Geom2dAdaptor_Curve in HC2d2 does not get initialized properly. Seems that this exception is raised for cases when Pcurve from edge for given face is equal to NULL.

Following fix should be made:
In method Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C,

                       const Standard_Real UFirst,
                       const Standard_Real ULast) it is necessary to
   add check 2D curve on NULL
   {
        if ( C.IsNULL()) Standard_ConstructionError::Raise();
   }

   In the BRepLib::tgtfaces(const TopoDS_Edge& Ed,
                     const TopoDS_Face& F1,
                     const TopoDS_Face& F2,
                     const Standard_Real ta,
                     const Standard_Boolean couture
   {
        Standard_Real aFirst, aLast
         if( BRep_Tool::CurveOnSurface(Ed,F1,aFirt,aLast).IsNull() ||
   BRep_Tool::CurveOnSurface(Ed,F2,aFirt,aLast).IsNull())
           return Standard_False;
   ..............................

   }
No tags attached.
Issue History
2011-08-01 11:39atpNew Issue
2011-08-01 11:39atpAssigned To => gka
2011-08-02 11:31bugmasterCategoryOCCT:MOA => OCCT:Modeling Algorithms
2011-09-21 11:12bugmasterTarget Version6.5.2 => 6.5.3
2011-09-22 16:58szyAssigned Togka => jgv
2011-09-22 16:58szyStatusnew => assigned
2012-02-09 09:19abvNote Added: 0019476
2012-03-12 07:30abvAssigned Tojgv => abv
2012-03-12 07:30abvStatusassigned => feedback
2012-04-02 18:04bugmasterStatusfeedback => tested
2012-04-02 18:04bugmasterStatustested => verified
2012-04-02 18:04bugmasterResolutionopen => fixed

Notes
(0019476)
abv   
2012-02-09 09:19   
This problem is likely to be fixed by #22789, to be checked after the release of OCCT 6.5.3