DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0027992

Modeling Algorithms - Extrema_ExtPS crashes on face without geometric surface

Open CASCADEOCCT:Modeling Algorithmsclosed15 public notes

Search issues

Description

Extrema_ExtPS crashes internally if shape contains faces without geometric surface.

Steps to reproduce

pload MODELING
restore [locate_data_file bug27821_nullsurf.brep] a
vertex v 0 0 0
distmini d v a

Public activity

15 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Extrema_ExtPS does not work directly with TopoDS_Face.
How to reproduce this issue?
02Author
Original crash occurs with the following code:

Handle(AIS_Shape) thePrs;
gp_Pnt thePoint;

const TopoDS_Shape& aShape = thePrs->Shape();
const gp_Trsf& aTrsf = thePrs->LocalTransformation();

// Project point on shape
BRep_Builder aB;
TopoDS_Vertex aSelVert;
aB.MakeVertex (aSelVert, thePoint, Precision::Confusion());

// here is a crash
BRepExtrema_DistShapeShape aDist (aSelVert, aShape.Located(aTrsf), Precision::Confusion());
if (aDist.IsDone())
{
  gp_Pnt aPoint = aDist.PointOnShape2(1);
}


I have not yet found the way for reproducing the issue using existing Draw Harness commands.
03Commenter 3
This will be the following:

vertex v <x> <y> <z>
distmini d v a
04Commenter 4
Probably the fix for 27991 will solve this bug.
05Commenter 5
Kirill, can you attach such surface, so that the issue can be checked?
06Author
The sample model bug27821_nullsurf.brep is in test base (and attached to original bug).
07Commenter 7
Apparently fix for #0027991 did not help -- the problem is reproduced (distmini raises access violation exception accessing null address) on 7.1.0.beta
08Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: msv
Date: Tue Nov 15 18:13:09 2016 +0300

    0027992: Modeling Algorithms - Extrema_ExtPS crashes on face without geometric surface
    
    The algorithm BRepExtrema_DistShapeShape has been protected against exceptions when non-geometric shape data is given on input, like a face containing triangulation only or an edge containing polygon only. Such faces/edges are ignored by the algorithm.
09Commenter 9
Dear Kirill, please review the fix.
10Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Nov 15 21:37:52 2016 +0300

    BRepGProps::VolumeProperties() now ignores faces without geometric surface to avoid access violation.

11Author
I confirm that patch solves NULL-dereference within application code.
I have put into the branch the fix solving remaining problem with BRepGProps::VolumeProperties().
12Commenter 12
OK, please test.
13Commenter 13
Dear BugMaster,
Branch CR27992 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 63 (63 on master)
Windows: 0 (0 on master)
MacOS : 1127

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27992-master-OCCT/Debian70-64/bugs/modalg_6/bug27992.html
http://occt-tests/CR27992-master-OCCT/Windows-64-VC10/bugs/modalg_6/bug27992.html
bugs modalg_6 bug27992: OK

Testing on Linux:
occt component :
Total MEMORY difference: 91515643 / 91877657 [-0.39%]
Total CPU difference: 21682.68000000028 / 21601.140000000312 [+0.38%]
products component :
Total MEMORY difference: 29995760 / 29935586 [+0.20%]
Total CPU difference: 5290.289999999985 / 5309.249999999963 [-0.36%]

Testing on Windows:
occt component :
Total MEMORY difference: 56587371 / 56597852 [-0.02%]
Total CPU difference: 20245.68497919853 / 19669.510885798518 [+2.93%]
products component :
Total MEMORY difference: 20822514 / 20790286 [+0.16%]
Total CPU difference: 5284.190672799971 / 5153.477434899959 [+2.54%]

There are no differences in images found by testdiff.
14Commenter 14
Dear BugMaster,
Branch CR27992 is TESTED.
15Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]

Related records