View Issue Details

IDProjectCategoryView StatusLast Update
0026321CommunityOCCT:Meshpublic2016-12-09 16:37
Reporterventu Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version6.8.0 
Target Version7.1.0Fixed in Version7.1.0 
Summary0026321: Crash in BRepMesh_FastDiscret::Add
DescriptionThis function:
1) starts with a try block,
2) there, it nullifies myAttribute;
3) construct a new BRepMesh_FaceAttribute and assigns it to myAttribute;
4) does other things;
5) catches Standard_Failure;
6) uses myAttributes within the catch block.

This leads to dereferencing a nullptr if an exception is thrown during the construction of the BRepMesh_FaceAttribute object.

This happened to me while meshing an imported STeP file which has a surface with an edge that has trimming limits outside its bounds.
The problem is however general.
Steps To ReproduceNot applicable
TagsNo tags attached.
Test case numberNot needed

Attached Files

  • sample.zip (3,102,244 bytes)

Activities

oan

2015-07-13 10:08

developer   ~0042946

Dear Ventu,

could you please attach problematic shape for QA reasons.

ventu

2015-07-16 16:21

reporter  

sample.zip (3,102,244 bytes)

ventu

2015-07-17 22:41

reporter   ~0043170

Shape attached.

oan

2015-07-20 15:14

developer   ~0043193

Dear Ventu,

Thank you! We will check and fix cause of the problem.

oan

2015-07-20 16:14

developer   ~0043196

Dear Ventu,

I just have tried to reproduce reported problem using OCCT 6.8.0 built in release mode via Draw test environment. I tried to change meshing parameters, but I did not face any crash.

I see possible bottleneck in the source code and we can fix it as is. However, it would be better to localize the problem using live data in order to register this case and prevent the similar ones in further.

Therefore, could you please specify exact meshing parameters or, probably, exact face using which crash can be reproduced? Additional question, do you use some specific parameters for STEP importer or parameters are default?

Thank you in advance,
Oleg.

ventu

2015-07-28 10:33

reporter   ~0043612

I'm not familiar with DRAW: I'm using OC as a library from a C++ program.

I'm reading the file through STEPCAFControl_Reader class, I believe with standard parameters.
I then use XCAFDoc_DocumentTool::ShapesLabel(Doc->Main()) to get all shapes.

On the first FACE of the first SHAPE, I do:
BRepMesh_IncrementalMesh M(Face,0.01,Standard_False,0.5,Standard_True);

Hence the crash.


Please let me know if this is enough or if I need to do something else.

git

2016-02-15 18:19

administrator   ~0050774

Branch CR26321 has been created by oan.

SHA-1: 4298fdbaf4ed4494e5fa0f537e66a20a180ea54e


Detailed log of new commits:

Author: oan
Date: Mon Feb 15 18:05:33 2016 +0300

    0026321: Crash in BRepMesh_FastDiscret::Add
    
    BRepMesh_FaceAttribute: distinguish constructor and parameters initialization.

oan

2016-02-16 11:35

developer   ~0050797

Dear Mikhail,

please review branch CR26321.

msv

2016-02-16 12:04

developer   ~0050801

src\BRepMesh\BRepMesh_FaceAttribute.hxx

1) Line 35 is to be removed.

git

2016-02-16 19:09

administrator   ~0050847

Branch CR26321 has been updated forcibly by oan.

SHA-1: 55d8db2ecbf1d514bef8bd662a157bbd41e253db

oan

2016-02-16 19:13

developer   ~0050848

Dear Mikhail,

done, please review.

msv

2016-02-17 16:03

developer   ~0050888

Reviewed.

git

2016-02-17 17:43

administrator   ~0050904

Branch CR26321 has been updated forcibly by apv.

SHA-1: 1aaff894b36d9a945b4924c93581f503dd45fa45

apv

2016-02-17 17:43

tester   ~0050905

Branch CR26321 has been rebased on the current master

apv

2016-02-18 15:09

tester   ~0050956

Dear BugMaster,

Branch CR26321 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 1aaff894b36d9a945b4924c93581f503dd45fa45

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MacOS: 0 (0 on master)
products component:
   Linux: 36 (36 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 90379875 / 89339274 [+1.16%]
Total CPU difference: 19209.629999999914 / 19290.29999999997 [-0.42%]

Testing on Windows:
Total MEMORY difference: 57364370 / 57374211 [-0.02%]
Total CPU difference: 18398.882740799036 / 18532.903199898905 [-0.72%]

git

2016-04-17 13:27

administrator   ~0052861

Branch CR26321 has been deleted by kgv.

SHA-1: 1aaff894b36d9a945b4924c93581f503dd45fa45

Related Changesets

occt: master 0a2a7b46

2016-02-16 16:08:13

oan


Committer: bugmaster Details Diff
0026321: Crash in BRepMesh_FastDiscret::Add

BRepMesh_FaceAttribute: distinguish constructor and parameters initialization.
Affected Issues
0026321
mod - src/BRepMesh/BRepMesh_FaceAttribute.cxx Diff File
mod - src/BRepMesh/BRepMesh_FaceAttribute.hxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscret.hxx Diff File

Issue History

Date Modified Username Field Change
2015-06-06 20:11 ventu New Issue
2015-06-06 20:11 ventu Assigned To => oan
2015-07-13 10:06 oan Assigned To oan => ventu
2015-07-13 10:08 oan Note Added: 0042946
2015-07-13 10:08 oan Status new => feedback
2015-07-16 16:21 ventu File Added: sample.zip
2015-07-17 22:41 ventu Note Added: 0043170
2015-07-20 15:04 oan Assigned To ventu => oan
2015-07-20 15:14 oan Note Added: 0043193
2015-07-20 15:14 oan Status feedback => assigned
2015-07-20 16:14 oan Note Added: 0043196
2015-07-20 16:14 oan Assigned To oan => ventu
2015-07-20 16:14 oan Status assigned => feedback
2015-07-28 10:33 ventu Note Added: 0043612
2015-08-03 10:50 ventu Assigned To ventu => oan
2015-12-17 12:00 abv Status feedback => assigned
2015-12-17 12:00 abv Target Version => 7.1.0
2016-02-15 18:19 git Note Added: 0050774
2016-02-15 18:20 oan Description Updated
2016-02-15 18:37 oan Steps to Reproduce Updated
2016-02-16 11:35 oan Note Added: 0050797
2016-02-16 11:35 oan Assigned To oan => msv
2016-02-16 11:35 oan Status assigned => resolved
2016-02-16 12:04 msv Note Added: 0050801
2016-02-16 12:04 msv Assigned To msv => oan
2016-02-16 12:04 msv Status resolved => assigned
2016-02-16 19:09 git Note Added: 0050847
2016-02-16 19:13 oan Note Added: 0050848
2016-02-16 19:13 oan Assigned To oan => msv
2016-02-16 19:13 oan Status assigned => resolved
2016-02-17 10:36 oan Target Version 7.1.0 => 7.0.0
2016-02-17 10:54 oan Target Version 7.0.0 => 7.1.0
2016-02-17 16:03 msv Note Added: 0050888
2016-02-17 16:03 msv Assigned To msv => bugmaster
2016-02-17 16:03 msv Status resolved => reviewed
2016-02-17 17:11 apv Assigned To bugmaster => apv
2016-02-17 17:43 git Note Added: 0050904
2016-02-17 17:43 apv Note Added: 0050905
2016-02-18 15:08 apv Test case number => Not needed
2016-02-18 15:09 apv Note Added: 0050956
2016-02-18 15:09 apv Assigned To apv => bugmaster
2016-02-18 15:09 apv Status reviewed => tested
2016-04-08 11:55 bugmaster Changeset attached => occt master 0a2a7b46
2016-04-08 11:55 bugmaster Status tested => verified
2016-04-08 11:55 bugmaster Resolution open => fixed
2016-04-17 13:27 git Note Added: 0052861
2016-12-09 16:33 aiv Status verified => closed
2016-12-09 16:37 aiv Fixed in Version => 7.1.0