View Issue Details

IDProjectCategoryView StatusLast Update
0024909CommunityOCCT:Modeling Algorithmspublic2024-01-31 18:42
Reportershoogen Assigned Toakondrat 
PrioritynormalSeveritycrash 
Status assignedResolutionopen 
PlatformLinux 64-bitOSDebian 
Product Version7.0.0 
Target VersionUnscheduled 
Summary0024909: Modeling Algorithms - SIGSEGV in buildsweep
DescriptionSome sweeps cause segmentation faults. The original problem is described http://www.freecadweb.org/tracker/view.php?id=1419 .

version tested 73192b374
Steps To Reproducebugs modalg_7 bug24909_1, bug24909_2, bug24909_3, bug24909_4
TagsNo tags attached.
Test case numberbugs modalg_7 bug24909_1, bug24909_2, bug24909_3

Attached Files

  • sweep3.draw (520 bytes)
  • sweep3-draw-Sweep-0-spine.brep (2,746 bytes)
  • sweep3-draw-Sweep-0-section-00-Sketch.brep (3,587 bytes)
  • sweep3-draw-Sweep-0-section-01-Sketch001.brep (3,635 bytes)
  • minihyd.zip (884 bytes)
  • sweep-arc2.zip (2,152 bytes)
  • sweep-negpara1.zip (3,230 bytes)

Relationships

has duplicate 0024906 closedshoogen Are commands in DRAWEXE for using MakePipeShellApi? 

Activities

shoogen

2014-05-08 13:43

reporter  

sweep3.draw (520 bytes)

shoogen

2014-05-08 13:44

reporter  

sweep3-draw-Sweep-0-spine.brep (2,746 bytes)

shoogen

2014-05-08 13:45

reporter  

sweep3-draw-Sweep-0-section-00-Sketch.brep (3,587 bytes)

shoogen

2014-05-08 13:45

reporter  

sweep3-draw-Sweep-0-section-01-Sketch001.brep (3,635 bytes)

shoogen

2014-05-08 13:53

reporter   ~0029255

if either of the sections is omitted the sweep returns a result.

shoogen

2014-05-08 18:08

reporter   ~0029262

the following script reproduces the problem without relying on external BREPs

pload ALL
circle c1 0 0 0 40
mkedge e1 c1
wire w1 e1
tcopy w1 Sketch002
tcopy w1 Sketch001
renamevar w1 Sketch
trotate Sketch 0 0 0 0. 1. 0. 90
ttranslate Sketch 0. 0. 75.
trotate Sketch001 0 0 0 0. 1. 0. 90
ttranslate Sketch001 0. 0. -75.
ttranslate Sketch002 50. 0. 0.
mksweep Sketch002
setsweep -CF
addsweep Sketch001
addsweep Sketch
buildsweep Sweep

#An exception was caught 0x7f61f1538031 : OSD_SIGSEGV: SIGSEGV 'segmentation violation' detected. Address 10
#** Exception ** 0x7f61f1538031 : OSD_SIGSEGV: SIGSEGV 'segmentation violation' detected. Address 10

shoogen

2014-10-18 19:23

reporter  

minihyd.zip (884 bytes)

shoogen

2014-10-18 19:28

reporter   ~0033302

#additional example for test case creation

#generated by FreeCAD 0.15.4119 +12 (Git)
pload MODELING
#saved shape of Part::Part2DObjectPython::Draft._BezCurve Object
restore minihyd-draw-BezCurve.brep BezCurve
ttranslate BezCurve 0 -8 0
explode BezCurve E
wire Sweep001-0-spine BezCurve_1
mksweep Sweep001-0-spine
setsweep -CF
circle Circle-curve 0 0 0 18
mkedge Circle-edge Circle-curve 0 0
wire Circle Circle-edge
trotate Circle 0 0 0 0.577350269189625731 0.577350269189625731 0.577350269189625731 120
ttranslate Circle 0 -71 203.5
addsweep Circle
circle Circle001-curve 0 0 0 16
mkedge Circle001-edge Circle001-curve 0 0
wire Circle001 Circle001-edge
trotate Circle001 0 0 0 0.577350269189625731 0.577350269189625731 0.577350269189625731 120
ttranslate Circle001 0 -71 203.5
addsweep Circle001
buildsweep Sweep001 -C -S
donly Sweep001


#SIGSEGV, Segmentation fault.
#0x00007fff8aab9559 in GeomFill_Array1OfSectionLaw::Value (this=0x10, Index=1)
# at occt-eb46b12/inc/TCollection_Array1.lxx:119
#119 Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);

shoogen

2014-12-01 23:28

reporter   ~0034897

Last edited: 2014-12-01 23:39

The test case sweep3.draw seems to be affected by 0025453 it does not longer create a sigsegv but a faulty shape
> checkshape Sweep
On Shape faulty_1 :
BRepCheck_UnorientableShape
Shape faulty_2 on shape faulty_1 :
BRepCheck_BadOrientationOfSubshape
On Shape faulty_3 :
BRepCheck_UnorientableShape
Shape faulty_4 on shape faulty_3 :
BRepCheck_BadOrientationOfSubshape

Faulty shapes in variables faulty_1 to faulty_4


But the other two examples (minihyd and from c29262) still create a SIGSEGV

shoogen

2015-01-17 19:04

reporter   ~0036177

Last edited: 2015-01-17 19:05

I got a new user report that generates a similar stacktrace. (DRAWEXE example included in sweep-arc2.zip)

shoogen

2015-01-17 19:04

reporter  

sweep-arc2.zip (2,152 bytes)

shoogen

2015-03-20 12:50

reporter  

sweep-negpara1.zip (3,230 bytes)

shoogen

2015-03-20 12:54

reporter   ~0038725

I got a new user report that generates a similar stacktrace. (DRAWEXE example included in sweep-negpara1.zip)
it involves an ellipse with negative parameter range:
"mkedge Ellipse-edge Ellipse-curve 3.141592653589793 0"

Program received signal SIGSEGV, Segmentation fault.
0x00007f97c7135eb1 in GeomFill_Array1OfSectionLaw::Value (this=0x10, Index=1)
    at occt/inc/TCollection_Array1.lxx:119
119	  Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);

apv

2017-08-01 13:24

tester   ~0069017

Problem described in issue is reproduced on current state of OCCT.

asuraven

2021-08-30 20:34

developer   ~0103561

Also we have an exception on following script (trying to sweep line along circle if line starts from circle's center):

pload ALL
circle c1 0 0 0 40
mkedge e1 c1
wire w1 e1
line l1 0 0 0 0 0 20
mkedge e2 l1 0 10
wire w2 e2
mksweep w1
addsweep w2
buildsweep sw1

git

2022-01-26 14:33

administrator   ~0106605

Branch CR24909 has been created by asuraven.

SHA-1: 3f6ba809a53935bbf6949565f7c16b2ffc44e495


Detailed log of new commits:

Author: asuraven
Date: Mon Jan 17 11:42:16 2022 +0300

    0024909: Modeling Algorithms - SIGSEGV in buildsweep
    
    Change NCollection_DataMap NCollection_IndexedDataMap to avoid undefined behavior in BRepFill_CompatibleWires::SameNumberByPolarMethod()
    
    Correction in BRepFill_PipeShell::Prepare()

git

2022-06-23 11:13

administrator   ~0109198

Branch CR24909 has been updated forcibly by akondrat.

SHA-1: c8338b6e9102ee7ba83318828b93ed85dbaa75f6

git

2022-07-19 09:37

administrator   ~0109873

Branch CR24909 has been updated forcibly by akondrat.

SHA-1: 2dfcbad9f5934835b489195773694f508921ac25

git

2022-07-26 09:55

administrator   ~0109992

Branch CR24909 has been updated forcibly by akondrat.

SHA-1: 53bce82008b2e83f605255d4a336954c86a8562a

git

2022-08-09 14:40

administrator   ~0110155

Branch CR24909 has been updated forcibly by akondrat.

SHA-1: 4b2a0e8e4916cc32b55ed4965fc4f4540e52ca50

git

2022-08-10 13:46

administrator   ~0110166

Branch CR24909 has been updated by akondrat.

SHA-1: e37b9225dae8333152edcab09794c3a27e00f91a


Detailed log of new commits:

Author: akondrat
Date: Wed Aug 10 13:45:58 2022 +0300

    0024909: Modeling Algorithms - SIGSEGV in buildsweep
    
    Update algorithm.

msv

2022-08-11 16:18

developer   ~0110195

-	    for (ii=1; ii<=Ext.NbExt(); ii++) {
+	    for (ii=1; ii<Ext.NbExt(); ii++) {

Why do you ignore the last solution?

git

2022-08-12 14:23

administrator   ~0110216

Branch CR24909 has been updated forcibly by akondrat.

SHA-1: 1f553d5e9237e137fd87efc2183802b70d909277

git

2022-08-18 08:27

administrator   ~0110274

Branch CR24909 has been updated forcibly by akondrat.

SHA-1: 96d4000f3b0f9ea868af7ce490d476ccc28726ff

msv

2022-08-30 14:25

developer   ~0110445

Wrong indentation (when using tab size 8):
         (U2 >= Ut21 - RealEpsilon())  &&
         (U2 <= Ut22 + RealEpsilon())) {
       Val = AlgExt.SquareDistance(i);
+    if (mypoints.IsEmpty())
+      mySqDist.Clear();
       mySqDist.Append(Val);
           if (!theIsInverse)

The same is in the file BRepFill_CompatibleWires.cxx, line 1159.

src/TopTools/TopTools_IndexedDataMapOfShapeListOfShape.hxx
Changes in this file bring inconsistency with other TopTools_Indexed*.hxx files. I propose to revert it and use TopTools_IndexedDataMapOfShapeListOfShape::Iterator where it is needed.

Why the new version passes map parameter by value?
 static Standard_Boolean SearchRoot (const TopoDS_Vertex& V,
-				    const TopTools_DataMapOfShapeListOfShape& Map,
-				    TopoDS_Vertex& VRoot)
+                                    const TopTools_IndexedDataMapOfShapeListOfShape Map,
+                                    TopoDS_Vertex& VRoot)


This code (line 1000) looks overcomplicated, taking into account that Init is an empty list:
      TopTools_ListOfShape* aShapeList = RMap.ChangeSeek(Vi);
      if (!aShapeList)
        aShapeList = &RMap(RMap.Add(Vi, Init));
      aShapeList->Append(Init);


Here (line 1041), aShapeList may take duplicated shape Vi.
    TopTools_ListOfShape* aShapeList = MapVLV.ChangeSeek(Vi);
    if (!aShapeList)
      aShapeList = &MapVLV(MapVLV.Add(Vi, Init));
    aShapeList->Append(Init);

Issue History

Date Modified Username Field Change
2014-05-08 13:43 shoogen New Issue
2014-05-08 13:43 shoogen Assigned To => ifv
2014-05-08 13:43 shoogen File Added: sweep3.draw
2014-05-08 13:44 shoogen File Added: sweep3-draw-Sweep-0-spine.brep
2014-05-08 13:45 shoogen File Added: sweep3-draw-Sweep-0-section-00-Sketch.brep
2014-05-08 13:45 shoogen File Added: sweep3-draw-Sweep-0-section-01-Sketch001.brep
2014-05-08 13:53 shoogen Note Added: 0029255
2014-05-08 18:08 shoogen Note Added: 0029262
2014-05-22 06:49 abv Relationship added has duplicate 0024906
2014-09-12 14:16 abv Target Version => 7.1.0
2014-10-18 19:23 shoogen File Added: minihyd.zip
2014-10-18 19:28 shoogen Note Added: 0033302
2014-12-01 23:28 shoogen Note Added: 0034897
2014-12-01 23:34 shoogen Note Edited: 0034897
2014-12-01 23:36 shoogen Note Edited: 0034897
2014-12-01 23:39 shoogen Note Edited: 0034897
2015-01-17 19:04 shoogen Note Added: 0036177
2015-01-17 19:04 shoogen File Added: sweep-arc2.zip
2015-01-17 19:05 shoogen Note Edited: 0036177
2015-03-20 12:50 shoogen File Added: sweep-negpara1.zip
2015-03-20 12:54 shoogen Note Added: 0038725
2016-10-28 11:54 msv Target Version 7.1.0 => 7.2.0
2017-07-21 11:34 msv Target Version 7.2.0 => 7.3.0
2017-08-01 13:24 apv Test case number => bugs modalg_7 bug24909_1, bug24909_2, bug24909_3
2017-08-01 13:24 apv Note Added: 0069017
2017-12-05 17:01 msv Target Version 7.3.0 => 7.4.0
2019-08-12 16:37 msv Target Version 7.4.0 => 7.5.0
2020-09-14 22:56 msv Target Version 7.5.0 => 7.6.0
2021-08-26 17:06 szy Assigned To ifv => asuraven
2021-08-26 17:06 szy Status new => assigned
2021-08-29 20:08 msv Target Version 7.6.0 => 7.7.0
2021-08-30 20:34 asuraven Note Added: 0103561
2021-11-27 11:58 kgv Summary SIGSEGV in buildsweep => Modeling Algorithms - SIGSEGV in buildsweep
2021-11-27 11:59 kgv Product Version => 7.0.0
2022-01-11 17:56 asuraven Time allocated 11.1.2022: 2 h. => set
2022-01-14 17:16 asuraven Time allocated 12.1.2022: 5 h. => set
2022-01-14 17:16 asuraven Time allocated 13.1.2022: 8 h. => set
2022-01-24 12:12 asuraven Time allocated 20.1.2022: 8 h. => set
2022-01-24 12:12 asuraven Time allocated 19.1.2022: 8 h. => set
2022-01-26 14:33 git Note Added: 0106605
2022-01-28 17:54 asuraven Time allocated 25.1.2022: 8 h. => set
2022-01-28 17:55 asuraven Time allocated 27.1.2022: 2.4 h. => set
2022-06-14 09:00 azv Assigned To asuraven => akondrat
2022-06-23 11:13 git Note Added: 0109198
2022-07-19 09:37 git Note Added: 0109873
2022-07-26 09:55 git Note Added: 0109992
2022-08-09 14:40 git Note Added: 0110155
2022-08-10 13:46 git Note Added: 0110166
2022-08-11 14:48 akondrat Assigned To akondrat => msv
2022-08-11 14:50 akondrat Status assigned => resolved
2022-08-11 14:50 akondrat Steps to Reproduce Updated
2022-08-11 16:18 msv Note Added: 0110195
2022-08-11 16:18 msv Assigned To msv => akondrat
2022-08-11 16:18 msv Status resolved => assigned
2022-08-12 14:23 git Note Added: 0110216
2022-08-18 08:27 git Note Added: 0110274
2022-08-22 13:28 akondrat Assigned To akondrat => msv
2022-08-22 13:28 akondrat Status assigned => resolved
2022-08-30 14:25 msv Note Added: 0110445
2022-08-30 14:26 msv Assigned To msv => akondrat
2022-08-30 14:26 msv Status resolved => assigned
2022-10-24 10:40 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:08 dpasukhi Target Version 7.8.0 => Unscheduled