View Issue Details

IDProjectCategoryView StatusLast Update
0027992Open CASCADEOCCT:Modeling Algorithmspublic2016-12-09 16:39
Reporterkgv Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2015 
Product Version6.3.1 
Target Version7.1.0Fixed in Version7.1.0 
Summary0027992: Modeling Algorithms - Extrema_ExtPS crashes on face without geometric surface
DescriptionExtrema_ExtPS crashes internally if shape contains faces without geometric surface.
Steps To Reproducepload MODELING
restore [locate_data_file bug27821_nullsurf.brep] a
vertex v 0 0 0
distmini d v a
TagsNo tags attached.
Test case numberbugs modalg_6 bug27992

Relationships

related to 0027991 closedapv Modeling Algorithms - BRepGProp_Face crashes on face without geometric surface 
related to 0028125 newmsv Modeling Algorithms - support of BRep shapes based on tessellated geometry 

Activities

msv

2016-10-24 10:31

developer   ~0058993

Extrema_ExtPS does not work directly with TopoDS_Face.
How to reproduce this issue?

kgv

2016-10-24 16:20

developer   ~0059033

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.

msv

2016-10-24 18:39

developer   ~0059045

This will be the following:

vertex v <x> <y> <z>
distmini d v a

msv

2016-10-24 18:40

developer   ~0059046

Probably the fix for 27991 will solve this bug.

abv

2016-11-14 21:27

manager   ~0060330

Kirill, can you attach such surface, so that the issue can be checked?

kgv

2016-11-14 21:30

developer   ~0060331

The sample model bug27821_nullsurf.brep is in test base (and attached to original bug).

abv

2016-11-15 08:43

manager   ~0060332

Apparently fix for 0027991 did not help -- the problem is reproduced (distmini raises access violation exception accessing null address) on 7.1.0.beta

git

2016-11-15 18:13

administrator   ~0060383

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.

msv

2016-11-15 18:15

developer   ~0060384

Dear Kirill, please review the fix.

git

2016-11-15 21:40

administrator   ~0060395

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.

kgv

2016-11-15 21:41

developer   ~0060396

I confirm that patch solves NULL-dereference within application code.
I have put into the branch the fix solving remaining problem with BRepGProps::VolumeProperties().

msv

2016-11-16 09:12

developer   ~0060400

OK, please test.

mkv

2016-11-17 12:45

tester   ~0060485

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.

mkv

2016-11-17 12:45

tester   ~0060486

Dear BugMaster,
Branch CR27992 is TESTED.

git

2016-12-07 11:30

administrator   ~0061254

Branch CR27992 has been deleted by kgv.

SHA-1: 82e686ea31c7be3f3ce2b27bce853d60b3c3fa37

Related Changesets

occt: master c894a5fd

2016-11-17 12:50:16

msv


Committer: apn Details Diff
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.

BRepGProps::VolumeProperties() now ignores faces without geometric surface to avoid access violation.
Affected Issues
0027992
mod - src/BRepExtrema/BRepExtrema_ExtCC.cxx Diff File
mod - src/BRepExtrema/BRepExtrema_ExtCF.cxx Diff File
mod - src/BRepExtrema/BRepExtrema_ExtFF.cxx Diff File
mod - src/BRepExtrema/BRepExtrema_ExtPC.cxx Diff File
mod - src/BRepExtrema/BRepExtrema_ExtPF.cxx Diff File
mod - src/BRepGProp/BRepGProp.cxx Diff File
mod - src/BRepTest/BRepTest_ExtremaCommands.cxx Diff File
add - tests/bugs/modalg_6/bug27992 Diff File
mod - tests/bugs/vis/bug27821 Diff File

Issue History

Date Modified Username Field Change
2016-10-22 19:25 kgv New Issue
2016-10-22 19:25 kgv Assigned To => msv
2016-10-22 19:25 kgv Relationship added related to 0027991
2016-10-24 10:31 msv Note Added: 0058993
2016-10-24 10:31 msv Assigned To msv => kgv
2016-10-24 10:31 msv Status new => feedback
2016-10-24 16:20 kgv Note Added: 0059033
2016-10-24 18:39 msv Note Added: 0059045
2016-10-24 18:40 msv Note Added: 0059046
2016-11-14 21:27 abv Note Added: 0060330
2016-11-14 21:30 kgv Note Added: 0060331
2016-11-15 08:43 abv Note Added: 0060332
2016-11-15 08:43 abv Steps to Reproduce Updated
2016-11-15 08:45 abv Target Version 7.1.0 => 7.2.0
2016-11-15 08:45 abv Assigned To kgv => msv
2016-11-15 08:45 abv Status feedback => assigned
2016-11-15 18:13 git Note Added: 0060383
2016-11-15 18:15 msv Note Added: 0060384
2016-11-15 18:15 msv Assigned To msv => kgv
2016-11-15 18:15 msv Status assigned => resolved
2016-11-15 21:40 git Note Added: 0060395
2016-11-15 21:41 kgv Note Added: 0060396
2016-11-15 21:41 kgv Assigned To kgv => msv
2016-11-15 21:41 kgv Target Version 7.2.0 => 7.1.0
2016-11-15 21:44 kgv Product Version 7.0.0 => 6.3.1
2016-11-16 09:12 msv Note Added: 0060400
2016-11-16 09:12 msv Assigned To msv => bugmaster
2016-11-16 09:12 msv Status resolved => reviewed
2016-11-16 14:09 mkv Assigned To bugmaster => mkv
2016-11-17 12:45 mkv Note Added: 0060485
2016-11-17 12:45 mkv Note Added: 0060486
2016-11-17 12:45 mkv Assigned To mkv => bugmaster
2016-11-17 12:45 mkv Status reviewed => tested
2016-11-17 12:46 mkv Test case number => bugs modalg_6 bug27992
2016-11-17 17:21 abv Relationship added related to 0028125
2016-11-18 16:37 apn Changeset attached => occt master c894a5fd
2016-11-18 16:37 apn Assigned To bugmaster => apn
2016-11-18 16:37 apn Status tested => verified
2016-11-18 16:37 apn Resolution open => fixed
2016-12-07 11:30 git Note Added: 0061254
2016-12-09 16:30 aiv Status verified => closed
2016-12-09 16:39 aiv Fixed in Version => 7.1.0