View Issue Details

IDProjectCategoryView StatusLast Update
0030201CommunityOCCT:Modeling Algorithmspublic2021-11-12 19:40
Reportergalbramc Assigned Tomsv  
PrioritynormalSeveritycrash 
Status assignedResolutionopen 
Product Version7.3.0 
Target Version7.7.0 
Summary0030201: Modeling Algorithms - ChFi3d_Builder::PerformMoreThreeCorner segfault by using nullptr
DescriptionBRep_Tool::CurveOnSurface on lines 2225 and 2235 can set curv2d1 or curv2d2 to null. These variables are then used without checking for the null value leading to a segfault. Throwing an exception in the following patch is a band aid that avoids the segfault, but does not resolve the desire for a fillet.

Index: src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
===================================================================
--- src/ChFi3d/ChFi3d_Builder_CnCrn.cxx (revision 1)
+++ src/ChFi3d/ChFi3d_Builder_CnCrn.cxx (working copy)
@@ -2226,6 +2226,7 @@
                                               u1bid,u2bid);
     else
       Calcul_C2dOnFace(CD.Value(ic),jf.Value(ic),i.Value(ic,icplus),curv2d1);
+ if(curv2d1.IsNull()) throw Standard_ConstructionError("PChFi3d_Builder::PerformMoreThreeCorner : curv2d1 is null");
     p2d1 = curv2d1 ->Value(p.Value(ic,icplus));
     
     // recuperation de la deuxieme courbe 2d
@@ -2237,6 +2238,7 @@
       jfp = 3 - jf.Value(icplus);
       Calcul_C2dOnFace(CD.Value(icplus),jfp,i.Value(icplus,ic),curv2d2);
     }
+ if(curv2d2.IsNull()) throw Standard_ConstructionError("PChFi3d_Builder::PerformMoreThreeCorner : curv2d2 is null");
     p2d2 = curv2d2 ->Value(p.Value(icplus,ic));
 
     Asurf = new GeomAdaptor_HSurface(BRep_Tool::Surface(TopoDS::Face(Fvive.Value(ic,icplus))));
Steps To ReproduceRun attached code with shape.brep.
TagsNo tags attached.
Test case number

Attached Files

  • ChFi3d_nullptr.tgz (6,763 bytes)

Relationships

related to 0031023 closedapn Fillet regression in OCCT 7.4 from 7.3 

Activities

galbramc

2018-10-04 19:01

reporter  

ChFi3d_nullptr.tgz (6,763 bytes)

galbramc

2019-01-23 16:23

reporter   ~0081867

Any luck with getting this use of a null pointer resolved?

galbramc

2021-11-07 18:53

reporter   ~0105055

Last edited: 2021-11-07 22:42

The segfault has been resolved in version 7.6.0, but the geometry construction still fails.

Issue History

Date Modified Username Field Change
2018-10-04 19:01 galbramc New Issue
2018-10-04 19:01 galbramc Assigned To => msv
2018-10-04 19:01 galbramc File Added: ChFi3d_nullptr.tgz
2018-10-12 20:41 abv Target Version => 7.4.0
2018-10-15 10:15 msv Assigned To msv => jgv
2018-10-15 10:15 msv Status new => assigned
2019-01-23 16:23 galbramc Note Added: 0081867
2019-08-12 17:59 msv Target Version 7.4.0 => 7.5.0
2019-10-11 11:40 abv Relationship added related to 0031023
2020-09-15 16:22 msv Target Version 7.5.0 => 7.6.0
2021-08-29 18:54 msv Target Version 7.6.0 => 7.7.0
2021-11-07 18:53 galbramc Note Added: 0105055
2021-11-07 22:05 jgv Assigned To jgv => bugmaster
2021-11-07 22:05 jgv Status assigned => feedback
2021-11-07 22:42 galbramc Note Edited: 0105055
2021-11-08 09:17 kgv Target Version 7.7.0 => 7.6.0
2021-11-12 14:39 szy Target Version 7.6.0 => 7.7.0
2021-11-12 19:40 kgv Summary ChFi3d_Builder::PerformMoreThreeCorner segfault by using nullptr => Modeling Algorithms - ChFi3d_Builder::PerformMoreThreeCorner segfault by using nullptr
2021-11-12 19:40 kgv Assigned To bugmaster => msv
2021-11-12 19:40 kgv Status feedback => assigned