MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032444Community[OCCT] OCCT:Modeling Algorithmspublic2021-06-16 16:122021-10-22 12:00
ReporterJerome Caucat 
Assigned ToJerome Caucat 
PrioritynormalSeveritycrash 
StatusfeedbackResolutionopen 
PlatformLinuxOSUbuntu 20.04OS Version64 bit
Product Version 
Target VersionFixed in Version 
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".
TagsNo tags attached.
Test case number
Attached Fileszip file icon sample.zip (10,476 bytes) 2021-06-16 16:12
patch file icon 0001-Fix-crash-0032444.patch (1,032 bytes) 2021-09-24 15:17
png file icon Screenshot.png (10,216 bytes) 2021-10-14 15:42
? file icon test_DT.tcl (403 bytes) 2021-10-14 16:29

- Relationships
related to 0032445feedbackJerome Caucat BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine 
related to 0032446feedbackJerome Caucat BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine 
related to 0031041assignedjgv Modeling Algorithms - Crash in BRepOffsetAPI_MakePipeShell 

-  Notes
(0104076)
Jerome Caucat (reporter)
2021-09-14 16:43

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?
(0104332)
Jerome Caucat (reporter)
2021-09-24 15:17

I added a patch suggestion.
(0104340)
kgv (developer)
2021-09-24 19:43

Jerome, does your patch with NULL-checks allows to produce expected result, or only protects from the crash?
(0104342)
Jerome Caucat (reporter)
2021-09-24 19:59

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?
(0104637)
akaftasev (developer)
2021-10-14 15:49
edited on: 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)

(0104640)
akaftasev (developer)
2021-10-14 16:28

I also attach script to recieve result on Screenshot.png
(0104647)
Jerome Caucat (reporter)
2021-10-15 12:06

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?
(0104654)
szy (manager)
2021-10-15 17:23

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.
(0104760)
git (administrator)
2021-10-20 12:39

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()
(0104761)
git (administrator)
2021-10-20 13:02

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()
(0104785)
akaftasev (developer)
2021-10-22 10:35

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.
(0104786)
Jerome Caucat (reporter)
2021-10-22 12:00

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

- 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 View Revisions
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


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker