MantisBT - Open CASCADE
View Issue Details
0027992Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2016-10-22 19:252016-12-09 16:39
kgv 
apn 
normalminor 
closedfixed 
WindowsVC++ 201564 bit
[OCCT] 6.3.1 
[OCCT] 7.1.0[OCCT] 7.1.0 
bugs modalg_6 bug27992
0027992: Modeling Algorithms - Extrema_ExtPS crashes on face without geometric surface
Extrema_ExtPS crashes internally if shape contains faces without geometric surface.
pload MODELING
restore [locate_data_file bug27821_nullsurf.brep] a
vertex v 0 0 0
distmini d v a
No tags attached.
related to 0027991closed apv Modeling Algorithms - BRepGProp_Face crashes on face without geometric surface 
related to 0028125new msv Modeling Algorithms - support of BRep shapes based on tessellated geometry 
Issue History
2016-10-22 19:25kgvNew Issue
2016-10-22 19:25kgvAssigned To => msv
2016-10-22 19:25kgvRelationship addedrelated to 0027991
2016-10-24 10:31msvNote Added: 0058993
2016-10-24 10:31msvAssigned Tomsv => kgv
2016-10-24 10:31msvStatusnew => feedback
2016-10-24 16:20kgvNote Added: 0059033
2016-10-24 18:39msvNote Added: 0059045
2016-10-24 18:40msvNote Added: 0059046
2016-11-14 21:27abvNote Added: 0060330
2016-11-14 21:30kgvNote Added: 0060331
2016-11-15 08:43abvNote Added: 0060332
2016-11-15 08:43abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15317#r15317
2016-11-15 08:45abvTarget Version7.1.0 => 7.2.0
2016-11-15 08:45abvAssigned Tokgv => msv
2016-11-15 08:45abvStatusfeedback => assigned
2016-11-15 18:13gitNote Added: 0060383
2016-11-15 18:15msvNote Added: 0060384
2016-11-15 18:15msvAssigned Tomsv => kgv
2016-11-15 18:15msvStatusassigned => resolved
2016-11-15 21:40gitNote Added: 0060395
2016-11-15 21:41kgvNote Added: 0060396
2016-11-15 21:41kgvAssigned Tokgv => msv
2016-11-15 21:41kgvTarget Version7.2.0 => 7.1.0
2016-11-15 21:44kgvProduct Version7.0.0 => 6.3.1
2016-11-16 09:12msvNote Added: 0060400
2016-11-16 09:12msvAssigned Tomsv => bugmaster
2016-11-16 09:12msvStatusresolved => reviewed
2016-11-16 14:09mkvAssigned Tobugmaster => mkv
2016-11-17 12:45mkvNote Added: 0060485
2016-11-17 12:45mkvNote Added: 0060486
2016-11-17 12:45mkvAssigned Tomkv => bugmaster
2016-11-17 12:45mkvStatusreviewed => tested
2016-11-17 12:46mkvTest case number => bugs modalg_6 bug27992
2016-11-17 17:21abvRelationship addedrelated to 0028125
2016-11-18 16:37apnChangeset attached => occt master c894a5fd
2016-11-18 16:37apnAssigned Tobugmaster => apn
2016-11-18 16:37apnStatustested => verified
2016-11-18 16:37apnResolutionopen => fixed
2016-12-07 11:30gitNote Added: 0061254
2016-12-09 16:30aivStatusverified => closed
2016-12-09 16:39aivFixed in Version => 7.1.0

Notes
(0058993)
msv   
2016-10-24 10:31   
Extrema_ExtPS does not work directly with TopoDS_Face.
How to reproduce this issue?
(0059033)
kgv   
2016-10-24 16:20   
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.
(0059045)
msv   
2016-10-24 18:39   
This will be the following:

vertex v <x> <y> <z>
distmini d v a
(0059046)
msv   
2016-10-24 18:40   
Probably the fix for 27991 will solve this bug.
(0060330)
abv   
2016-11-14 21:27   
Kirill, can you attach such surface, so that the issue can be checked?
(0060331)
kgv   
2016-11-14 21:30   
The sample model bug27821_nullsurf.brep is in test base (and attached to original bug).
(0060332)
abv   
2016-11-15 08:43   
Apparently fix for 0027991 did not help -- the problem is reproduced (distmini raises access violation exception accessing null address) on 7.1.0.beta
(0060383)
git   
2016-11-15 18:13   
Branch CR27992 has been created by msv.

SHA-1: 7051e6f6221f196f893d64534962fec39bcc2330


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.
(0060384)
msv   
2016-11-15 18:15   
Dear Kirill, please review the fix.
(0060395)
git   
2016-11-15 21:40   
Branch CR27992 has been updated by kgv.

SHA-1: 82e686ea31c7be3f3ce2b27bce853d60b3c3fa37


Detailed log of new commits:

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

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

(0060396)
kgv   
2016-11-15 21:41   
I confirm that patch solves NULL-dereference within application code.
I have put into the branch the fix solving remaining problem with BRepGProps::VolumeProperties().
(0060400)
msv   
2016-11-16 09:12   
OK, please test.
(0060485)
mkv   
2016-11-17 12:45   
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.
SHA-1: 82e686ea31c7be3f3ce2b27bce853d60b3c3fa37

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.
(0060486)
mkv   
2016-11-17 12:45   
Dear BugMaster,
Branch CR27992 is TESTED.
(0061254)
git   
2016-12-07 11:30   
Branch CR27992 has been deleted by kgv.

SHA-1: 82e686ea31c7be3f3ce2b27bce853d60b3c3fa37