Archived issue #0031125

BRepMesh_IncrementalMesh crash in constructor for empty compound shape

CommunityOCCT:Meshclosed7 public notes

Search issues

Description

New bug in 7.4.0:

I have some unit tests that uses boolean operations to create an empty shape. (shape is completely clipped out, so the result should be empty)

The boolean operation then results in a TCompound with zero shapes.

When I try to run this through IncrementalMesh, it crashes on line 111 in BrepMesh_IncrementalMesh.cxx:

  for (Standard_Integer aFaceIt = 0; aFaceIt < aModel->FacesNb(); ++aFaceIt)

because aModel is null. There is missing some error checking or at least null checking in this function.

This worked in 7.3.0

Steps to reproduce

compound c
incmesh c 1

Additional information

Regression vs 7.3.0

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Nov 4 17:09:09 2019 +0300

    0031125: BRepMesh_IncrementalMesh crash in constructor for empty compound shape
    Added check for cases of empty shapes producing null models

02Commenter 3
Hello Author,

Thank you for reporting the issue.
Draft version of the patch is ready and will be integrated as soon as it pass certification procedure.
03Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 3.

[revision removed]
04Commenter 3
05Commenter 5
Reviewed.
06Commenter 1
Tested in framework of WEEK-45

Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16844.70000000007 / 16848.430000000117 [-0.02%]
Products
Total CPU difference: 10837.970000000065 / 10873.690000000062 [-0.33%]
Windows-64-VC14:
OCCT
Total CPU difference: 18366.671875 / 18319.515625 [+0.26%]
Products
Total CPU difference: 12848.578125 / 12848.859375 [-0.00%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
07Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]