View Issue Details

IDProjectCategoryView StatusLast Update
0032444CommunityOCCT:Modeling Algorithmspublic2021-11-02 21:09
ReporterJerome Caucat Assigned Tosmoskvin 
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformLinuxOSUbuntu 20.04 
Target Version7.6.0Fixed in Version7.6.0 
Summary0032444: BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine
DescriptionUsing OCCT 7.5.2 with the patch for https://tracker.dev.opencascade.org/view.php?id=29645 and https://tracker.dev.opencascade.org/view.php?id=31147.

When trying to build a pipe with the provided spine, profiles and .tcl file I get a crash in C++ and in DRAW, with the following error in DRAW:

An exception was caught 0x555b1fa4b5c0 : OSD_SIGSEGV: SIGSEGV 'segmentation violation' detected. Address 60

I am using "DT_ShapeDivide" with a tolerance of 0.001 on the spine, "setsweep -DT" and "buildsweep r -C -S".
Steps To Reproducetest bugs modalg_7 bug32444
TagsNo tags attached.
Test case numberbugs modalg_7 bug32444

Attached Files

  • sample.zip (10,476 bytes)
  • 0001-Fix-crash-0032444.patch (1,032 bytes)
  • Screenshot.png (10,216 bytes)
  • test_DT.tcl (403 bytes)

Relationships

related to 0032445 closedakaftasev BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine 
related to 0032446 closedakaftasev BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine 
related to 0031041 assignedastromko Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell 

Activities

Jerome Caucat

2021-06-16 16:12

reporter  

sample.zip (10,476 bytes)

Jerome Caucat

2021-09-14 16:43

reporter   ~0104076

The problem is still reproduced with OCCT 7.5.3.


In the function BRepFill_TrimShellCorner::ChooseSection in the file src/BRepFill/BRepFill_TrimShellCorner.cxx two edges, FirstEdge and LastEdge, are initialized with the result of the function FindEdgeCloseToBisectorPlane.

But in our case FindEdgeCloseToBisectorPlane fails and LastEdge is null.

LastEdge is then used without being tested for nullity, which causes the crash.


The same problem happens for https://tracker.dev.opencascade.org/view.php?id=32445.

And for https://tracker.dev.opencascade.org/view.php?id=32446 it is FirstEdge that is null.

This bug https://tracker.dev.opencascade.org/view.php?id=31041 is also potentially related.


I suppose a possible fix could be to check that FirstEdge and LastEdge are not null before using them.

But what makes FindEdgeCloseToBisectorPlane fail? It is some criteria of the spine? Can the situation be detected upstream?

Jerome Caucat

2021-09-24 15:17

reporter  

0001-Fix-crash-0032444.patch (1,032 bytes)

Jerome Caucat

2021-09-24 15:17

reporter   ~0104332

I added a patch suggestion.

kgv

2021-09-24 19:43

developer   ~0104340

Jerome, does your patch with NULL-checks allows to produce expected result, or only protects from the crash?

Jerome Caucat

2021-09-24 19:59

reporter   ~0104342

It only protects from the crash.

I believe the root of the problem is that FindEdgeCloseToBisectorPlane fails. Is it because of the spine?

Is there a way to adapt the tolerance parameter of DT_ShapeDivide to the spine?

akaftasev

2021-10-14 15:42

developer  

Screenshot.png (10,216 bytes)

akaftasev

2021-10-14 15:49

developer   ~0104637

Last edited: 2021-10-14 17:45

Dear Jerome Caucat, on attached profiles and spine you can recieve correct result, when do not use '-C' or '-R' parameters in 'buildsweep' command (resulting shape you can see on the attached Screenshot.png)

akaftasev

2021-10-14 16:28

developer   ~0104640

I also attach script to recieve result on Screenshot.png

akaftasev

2021-10-14 16:29

developer  

test_DT.tcl (403 bytes)

Jerome Caucat

2021-10-15 12:06

reporter   ~0104647

Dear akaftasev, thank you for your feedback.

Not using the '-C' or '-R' parameters in 'buildsweep' only works properly if enough profiles are given according to the spine, otherwise the pipe may be distorted. So in order to apply this in a generic pipe making function, I will have to detect situations when this is applicable.

Regarding the crash, do you plan on releasing a fix?

szy

2021-10-15 17:23

manager   ~0104654

Dear Jerome,
Could you confirm that the proposed solution doesn't cover your case and you ask estimation for the case with parameter "-C".
Thanks.

git

2021-10-20 12:39

administrator   ~0104760

Branch CR32444 has been created by andrey.kaftasev_159541.

SHA-1: 16514cd84731295e2ba55d44b7143c19046de006


Detailed log of new commits:

Author: akaftasev
Date: Wed Oct 20 12:38:16 2021 +0300

    0032444: Modeling Algorithm - BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine
    
    Added checking for null edges in BRepFill_TrimShellCorner::ChooseSection()

git

2021-10-20 13:02

administrator   ~0104761

Branch CR32444_1 has been created by andrey.kaftasev_159541.

SHA-1: 08b460a5ca5cb54691618bd21873dbb8a60cb9ea


Detailed log of new commits:

Author: akaftasev
Date: Wed Oct 20 13:02:09 2021 +0300

    0032444: Modeling Algorithm - BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine
    
    Added checking for null edges in BRepFill_TrimShellCorner::ChooseSection()

akaftasev

2021-10-22 10:35

developer   ~0104785

Dear Jerome Caucat, we have tested your attached patch. We confirm that it fixes the crash, but the shape is still not valid.
Nevertheless we may integrate it to version 7.6.0 (coming soon) if you have not objections. Confirm it, please.

Anyway, with the ā€˜-Cā€™ parameter, the problem lies in the intersection of parts of the resulting shape and their trimming.
Most likely, the potential patch 0032447 may fix these bugs. It may be confirmed after patch implementation only.

Jerome Caucat

2021-10-22 12:00

reporter   ~0104786

Dear akaftasev, I have no objections, please use my patch if its fix is correct.

git

2021-10-26 15:46

administrator   ~0104879

Branch CR32444_1 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: d83c8ad365cadbe87003765460a77a337dae650c

akaftasev

2021-10-27 11:07

developer   ~0104893

Branch for review:
OCCT - CR32444_1

Results of testing:
http://jenkins-test-occt.nnov.opencascade.com/view/CR32444-master-akaftasev/view/COMPARE/

jgv

2021-10-29 16:54

developer   ~0104966

Reviewed.

Branches for integration:
OCCT ā€“ CR32444_1
Products ā€“ NOT

smoskvin

2021-10-30 11:21

administrator   ~0104980

Combination -
OCCT branch : OCCT-760
master SHA - 0d186a91c07a6217cd132ec7ea03f1e6f7a2a9ce
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : OCCT-760 SHA - c472aa8da77ba932a88c890c58c81b09f9ae00b5
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: 17728.310000000427 / 17750.15000000046 [-0.12%]
Products
Total CPU difference: 11578.090000000113 / 11624.980000000118 [-0.40%]
Windows-64-VC14:
OCCT
Total CPU difference: 19746.84375 / 19683.796875 [+0.32%]
Products
Total CPU difference: 12740.0 / 10994.3125 [+15.88%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-11-02 21:09

administrator   ~0105019

Branch CR32444 has been deleted by mnt.

SHA-1: 16514cd84731295e2ba55d44b7143c19046de006

git

2021-11-02 21:09

administrator   ~0105020

Branch CR32444_1 has been deleted by mnt.

SHA-1: d83c8ad365cadbe87003765460a77a337dae650c

Related Changesets

occt: master 0c4931e8

2021-10-20 10:02:09

akaftasev


Committer: smoskvin Details Diff
0032444: Modeling Algorithm - BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine

Added checking for null edges in BRepFill_TrimShellCorner::ChooseSection()
Affected Issues
0032444
mod - src/BRepFill/BRepFill_TrimShellCorner.cxx Diff File
add - tests/bugs/modalg_7/bug32444 Diff File

Issue History

Date Modified Username Field Change
2021-06-16 16:12 Jerome Caucat New Issue
2021-06-16 16:12 Jerome Caucat Assigned To => msv
2021-06-16 16:12 Jerome Caucat File Added: sample.zip
2021-09-14 16:43 Jerome Caucat Note Added: 0104076
2021-09-14 16:50 msv Relationship added related to 0032445
2021-09-14 16:51 msv Relationship added related to 0032446
2021-09-14 16:51 msv Relationship added related to 0031041
2021-09-24 15:17 Jerome Caucat File Added: 0001-Fix-crash-0032444.patch
2021-09-24 15:17 Jerome Caucat Note Added: 0104332
2021-09-24 19:43 kgv Note Added: 0104340
2021-09-24 19:59 Jerome Caucat Note Added: 0104342
2021-10-14 15:42 akaftasev File Added: Screenshot.png
2021-10-14 15:49 akaftasev Note Added: 0104637
2021-10-14 15:49 akaftasev Assigned To msv => Jerome Caucat
2021-10-14 15:49 akaftasev Status new => feedback
2021-10-14 16:28 akaftasev Note Added: 0104640
2021-10-14 16:29 akaftasev File Added: test_DT.tcl
2021-10-14 17:45 szy Note Edited: 0104637
2021-10-15 12:06 Jerome Caucat Note Added: 0104647
2021-10-15 17:23 szy Note Added: 0104654
2021-10-20 12:39 git Note Added: 0104760
2021-10-20 13:02 git Note Added: 0104761
2021-10-22 10:35 akaftasev Note Added: 0104785
2021-10-22 12:00 Jerome Caucat Note Added: 0104786
2021-10-26 15:46 git Note Added: 0104879
2021-10-27 11:07 akaftasev Note Added: 0104893
2021-10-27 11:07 akaftasev Assigned To Jerome Caucat => jgv
2021-10-27 11:07 akaftasev Status feedback => resolved
2021-10-27 11:07 akaftasev Steps to Reproduce Updated
2021-10-29 16:50 akaftasev Test case number => bugs modalg_7 bug32444
2021-10-29 16:54 jgv Note Added: 0104966
2021-10-29 16:54 jgv Assigned To jgv => bugmaster
2021-10-29 16:54 jgv Status resolved => reviewed
2021-10-29 17:16 bugmaster Target Version => 7.6.0
2021-10-30 11:21 smoskvin Note Added: 0104980
2021-10-30 11:21 smoskvin Status reviewed => tested
2021-11-02 17:57 smoskvin Changeset attached => occt master 0c4931e8
2021-11-02 17:57 smoskvin Assigned To bugmaster => smoskvin
2021-11-02 17:57 smoskvin Status tested => verified
2021-11-02 17:57 smoskvin Resolution open => fixed
2021-11-02 21:09 git Note Added: 0105019
2021-11-02 21:09 git Note Added: 0105020