View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033090 | Community | OCCT:Modeling Algorithms | public | 2022-08-05 17:00 | 2022-08-05 21:22 |
Reporter | christoph.jung_153651 | Assigned To | |||
Priority | normal | Severity | crash | ||
Status | assigned | Resolution | open | ||
Platform | Windows | OS | VC++ 2015 | ||
Product Version | 7.4.0 | ||||
Summary | 0033090: Access violation using fuzzy boolean operations | ||||
Description | While debugging the code in the field reproduction, an access violation was reported by MS VS. The attached file contains the necessary data. Occurs in OCCT 7.4.0. Respective Code is unchanged in OCCT 7.6.0: happens if myUparams.IsNull() in void IntTools_SurfaceRangeLocalizeData::SetFrame(const Standard_Real theUMin, const Standard_Real theUMax, const Standard_Real theVMin, const Standard_Real theVMax) { myUIndMin = 0; myUIndMax = 0; myVIndMin = 0; myVIndMax = 0; if (myUParams.IsNull() || myVParams.IsNull()) { return; } The routine is used in IntTools\IntTools_BeanFaceIntersector.cxx void BuildBox(const Handle(Geom_BSplineSurface) &theSurf, const Standard_Real theFirstU, const Standard_Real theLastU, const Standard_Real theFirstV, const Standard_Real theLastV, IntTools_SurfaceRangeLocalizeData &theSurfaceData, Bnd_Box &theBox) { Standard_Integer i; Standard_Integer j; Standard_Integer aNbUPnts; Standard_Integer aNbVPnts; Standard_Real aParam; gp_Pnt aPnt; theSurfaceData.SetFrame(theFirstU, theLastU, theFirstV, theLastV); aNbUPnts = theSurfaceData.GetNBUPointsInFrame(); aNbVPnts = theSurfaceData.GetNBVPointsInFrame(); // Add corner points. theSurf->D0(theFirstU, theFirstV, aPnt); theBox.Add(aPnt); theSurf->D0(theLastU, theFirstV, aPnt); theBox.Add(aPnt); theSurf->D0(theFirstU, theLastV, aPnt); theBox.Add(aPnt); theSurf->D0(theLastU, theLastV, aPnt); theBox.Add(aPnt); for (i = 1; i <= aNbUPnts; i++) { // Add top and bottom points. aParam = theSurfaceData.GetUParamInFrame(i); and the access violation occurs then in GetUParamInFrame(i), because e.g. aNbUPnts = 1, because: inline Standard_Integer IntTools_SurfaceRangeLocalizeData:: GetNBUPointsInFrame() const { return myUIndMax - myUIndMin + 1; } 0-0+1 = 1 | ||||
Steps To Reproduce | This would be a model to reproduce the bug: TopoDS_Shape s; BRep_Builder b; std::ifstream is; is.open("D://EF.brep"); BRepTools::Read(s, is, b); is.close(); TopExp_Explorer exp(s, TopAbs_FACE); TopExp_Explorer expe(s, TopAbs_EDGE); IntTools_EdgeFace* in = new IntTools_EdgeFace(); in->SetEdge(TopoDS::Edge(expe.Current())); in->SetFuzzyValue(0.1); in->SetFace(TopoDS::Face(exp.Current())); in->UseQuickCoincidenceCheck(false); in->SetRange(5.1673518776073308, 6.7381478044021721); in->Perform(); | ||||
Additional information and documentation updates | The problem does not occur if using the following code: src/IntTools/IntTools_SurfaceRangeLocalizeData.lxx + 2 - 2 Viewed @@ -115,13 +115,13 @@ inline const gp_Pnt &IntTools_SurfaceRangeLocalizeData::GetGridPoint inline Standard_Integer IntTools_SurfaceRangeLocalizeData:: GetNBUPointsInFrame() const { - return myUIndMax - myUIndMin + 1; + return myUParams.IsNull()? 0 : myUIndMax - myUIndMin + 1; } inline Standard_Integer IntTools_SurfaceRangeLocalizeData:: GetNBVPointsInFrame() const { - return myVIndMax - myVIndMin + 1; + return myVParams.IsNull()? 0 : myVIndMax - myVIndMin + 1; } | ||||
Tags | No tags attached. | ||||
Test case number | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2022-08-05 17:00 | christoph.jung_153651 | New Issue | |
2022-08-05 17:00 | christoph.jung_153651 | Assigned To | => msv |
2022-08-05 21:22 |
|
Assigned To | msv => akondrat |
2022-08-05 21:22 |
|
Status | new => assigned |