MantisBT - Community
View Issue Details
0026064Community[OCCT] OCCT:Modeling Algorithmspublic2015-04-13 13:192015-05-14 16:35
shoogen 
bugmaster 
highmajor 
closedfixed 
LinuxDebian 6.064 bit
[OCCT] 6.8.0 
[OCCT] 6.9.0[OCCT] 6.9.0 
bugs modalg_6(011) bug26064
0026064: distmini of two edges locks up
When requesting the distmini of the attached shapes, the application locks up.
Form a user perspective this results in crashing the application. We use the function in the GUI to provide snapping on shape intersections. So (for us) it would be helpful to abort the extrema operation.
pload MODELING
restore dist1-s1.brep s1
restore dist1-s2.brep s2
distmini d s1 s2
#0 0x00007fb9a2a06183 in TCollection_BaseSequence::Find (this=0x7ffebf3f0620,
    Index=9743)
    at occt/src/TCollection/TCollection_BaseSequence.cxx:351
0000001 0x00007fb9a29fc924 in TColStd_SequenceOfReal::ChangeValue (this=
    0x7ffebf3f0620, Index=9743)
    at occt/inc/TCollection_Sequence.gxx:135
0000002 0x00007fb9a2ee96b6 in TColStd_SequenceOfReal::operator() (this=
    0x7ffebf3f0620, Index=9743)
    at occt/inc/TColStd_SequenceOfReal.hxx:79
#3 0x00007fb996a4fa4b in Extrema_ECC::Perform (this=0x7ffebf3ee5d0)
    at occt/inc/Extrema_GenExtCC.gxx:190
#4 0x00007fb996a7530b in Extrema_ExtCC::Perform (this=0x7ffebf3ee5d0)
    at occt/src/Extrema/Extrema_ExtCC.cxx:255
#5 0x00007fb99794e570 in BRepExtrema_ExtCC::Perform (this=0x7ffebf3ee5d0,
    E1=...)
    at occt/src/BRepExtrema/BRepExtrema_ExtCC.cxx:68
#6 0x00007fb99794e103 in BRepExtrema_ExtCC::BRepExtrema_ExtCC (this=
    0x7ffebf3ee5d0, E1=..., E2=...)
    at occt/src/BRepExtrema/BRepExtrema_ExtCC.cxx:33
0000007 0x00007fb997949261 in BRepExtrema_DistanceSS::Perform (this=
    0x7ffebf3f0c40, S1=..., S2=..., B1=..., B2=...)
No tags attached.
related to 0026075closed bugmaster Open CASCADE Make Extrema_GenExtCC return IsParallel flag in case of parallel curves 
? dist1-s1.brep (664) 2015-04-13 13:19
https://tracker.dev.opencascade.org/
? dist1-s2.brep (1,610) 2015-04-13 13:19
https://tracker.dev.opencascade.org/
Issue History
2015-04-13 13:19shoogenNew Issue
2015-04-13 13:19shoogenAssigned To => msv
2015-04-13 13:19shoogenFile Added: dist1-s1.brep
2015-04-13 13:19shoogenFile Added: dist1-s2.brep
2015-04-13 20:44shoogenNote Added: 0039658
2015-04-13 21:42abvPrioritynormal => high
2015-04-13 21:42abvStatusnew => assigned
2015-04-13 21:42abvTarget Version => 6.9.0
2015-04-14 06:31gitNote Added: 0039659
2015-04-14 06:36abvNote Added: 0039660
2015-04-14 06:36abvStatusassigned => resolved
2015-04-14 16:55gitNote Added: 0039691
2015-04-14 16:56msvNote Added: 0039692
2015-04-14 16:56msvAssigned Tomsv => abv
2015-04-14 17:01msvNote Added: 0039695
2015-04-14 17:40msvRelationship addedrelated to 0026075
2015-04-14 17:58msvNote Added: 0039703
2015-04-14 17:58msvAssigned Toabv => bugmaster
2015-04-14 17:58msvStatusresolved => reviewed
2015-04-14 19:05apvAssigned Tobugmaster => apv
2015-04-15 00:51msvNote Added: 0039729
2015-04-15 10:21abvNote Added: 0039735
2015-04-15 10:48msvNote Added: 0039743
2015-04-15 19:01apvNote Added: 0039811
2015-04-15 19:01apvAssigned Toapv => msv
2015-04-15 19:01apvStatusreviewed => assigned
2015-04-16 06:35gitNote Added: 0039817
2015-04-16 06:37abvNote Added: 0039818
2015-04-16 06:37abvStatusassigned => resolved
2015-04-16 06:37abvNote Added: 0039819
2015-04-16 06:37abvAssigned Tomsv => bugmaster
2015-04-16 06:37abvStatusresolved => reviewed
2015-04-16 12:11apvAssigned Tobugmaster => apv
2015-04-17 15:53gitNote Added: 0039968
2015-04-17 15:54apvNote Added: 0039969
2015-04-24 16:04gitNote Added: 0040213
2015-04-24 16:04apvNote Added: 0040214
2015-04-27 13:12apvNote Added: 0040271
2015-04-27 13:12apvAssigned Toapv => bugmaster
2015-04-27 13:12apvStatusreviewed => tested
2015-05-05 16:48apvTest case number => bugs modalg_6(011) bug26064
2015-05-07 11:18bugmasterChangeset attached => occt master 6ca1fa70
2015-05-07 11:18bugmasterStatustested => verified
2015-05-07 11:18bugmasterResolutionopen => fixed
2015-05-14 15:28aivStatusverified => closed
2015-05-14 15:30aivFixed in Version => 6.9.0
2015-05-14 16:35gitNote Added: 0041084
2015-05-14 16:35gitNote Added: 0041085

Notes
(0039658)
shoogen   
2015-04-13 20:44   
I got problems to reproduce the problem in a release build.
(0039659)
git   
2015-04-14 06:31   
Branch CR26064 has been created by abv.

SHA-1: 78d46f8c809cbb49a0a3a4b8db8d2cdb4a6f61ff


Detailed log of new commits:

Author: abv
Date: Tue Apr 14 06:29:41 2015 +0300

    0026064: distmini of two edges locks up
    
    Method Extrema_GenExtCC::Perform() refactored to avoid very inefficient (O(N^2)) algorithm of removal of duplicate points at the end. Instead, duplications are checked when new points are added.
    
    Fields are initialized in constructors of the class Extrema_GenExtCC; unused instances of generic classes (duplications) ELCC and ELCC2d removed.
    
    Test case bugs/modalg_6/bug26064 added.
(0039660)
abv   
2015-04-14 06:36   
The reason of hang up is that on these two parallel edges algorithm finds 49377 extrema points, and then hangs in code intended to remove duplications in this sequence (O(N^3)). Partial fix integrated in CR26064 removes this inefficiency, however it is still very slow (46 sec on i7-4790) and still finds 49377 solutions... Please review and consider possible improvement to avoiod that many solutions
(0039691)
git   
2015-04-14 16:55   
Branch CR26064 has been updated by msv.

SHA-1: 4fcd0f9fbd5fae5d239bea1b6e652bf3551bf582


Detailed log of new commits:

Author: msv
Date: Tue Apr 14 16:55:30 2015 +0300

    Some more minor code optimizations.

(0039692)
msv   
2015-04-14 16:56   
I have made some more minor code optimizations.
Please review.
(0039695)
msv   
2015-04-14 17:01   
This patch is just a quick solution. It is needed to review the code in order to not return a tons of solution points in the case of parallel curves, instead the algorithm must set the flag IsParallel and return only the distance. For this revision a new issue will be created.
(0039703)
msv   
2015-04-14 17:58   
Reviewed. Please test.
(0039729)
msv   
2015-04-15 00:51   
As for test case, I suggest inserting a cpulimit command to restrict the time of distmini for this case. A reasonable value of cpulimit is 120 sec.
(0039735)
abv   
2015-04-15 10:21   
Mikhail, I believe that default value of cpulimit (1000) is more appropriate, considering case of running Debug builds on slow machines
(0039743)
msv   
2015-04-15 10:48   
OK.
(0039811)
apv   
2015-04-15 19:01   
Dear BugMaster,

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

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
http://occt-tests/CR26064-master-occt-64/Debian60-64/summary.html [^]
http://occt-tests/CR26064-master-occt-64/Windows-64-VC10/summary.html [^]
bugs modalg_1(006) buc60942
bugs modalg_5(010) bug23706_10, bug23706_11, bug23706_13
bugs moddata(012) buc60890

Testing on Linux:
Total MEMORY difference: 94160450 / 94297594 [-0.15%]
Total CPU difference: 50177.73999999968 / 56190.019999999706 [-10.70%]

Testing on Windows:
Total MEMORY difference: 57129384 / 57127079 [+0.00%]
Total CPU difference: 16736.754486198774 / 15975.563206798899 [+4.76%]
(0039817)
git   
2015-04-16 06:35   
Branch CR26064_1 has been created by abv.

SHA-1: 4f1549076d552ded9785b540114f522dd9011760


Detailed log of new commits:

Author: abv
Date: Wed Apr 15 22:40:58 2015 +0300

    0026064: distmini of two edges locks up
    
    Method Extrema_GenExtCC::Perform() refactored to avoid very inefficient (O(N^2)) algorithm of removal of duplicate points at the end. Instead, duplications are checked when new points are added.
    
    Fields are initialized in constructors of the class Extrema_GenExtCC; unused instances of generic classes (duplications) ELCC and ELCC2d removed.
    
    Test case bugs/modalg_6/bug26064 added.
(0039818)
abv   
2015-04-16 06:37   
It was my stupid error with wrong index variable used in the cycle...
(0039819)
abv   
2015-04-16 06:37   
Fix pushed to CR26064_1, please re-test
(0039968)
git   
2015-04-17 15:53   
Branch CR26064_1 has been updated forcibly by apv.

SHA-1: edbb57b9b3e8e4cc222cd9da3b4efafba61c6961
(0039969)
apv   
2015-04-17 15:54   
Branch CR26064_1 has been rebased on the current master
(0040213)
git   
2015-04-24 16:04   
Branch CR26064_1 has been updated forcibly by apv.

SHA-1: e02bfc0944e37ef28bc570d73e2df0e7b63b9d10
(0040214)
apv   
2015-04-24 16:04   
Branch CR26064_1 has been rebased on the current master
(0040271)
apv   
2015-04-27 13:12   
Dear BugMaster,

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

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
bugs modalg_6(011) bug26064 - OK
http://occt-tests/CR26064-1-master-occt-64/Debian60-64/bugs/modalg_6/bug26064.html [^]
http://occt-tests/CR26064-1-master-occt-64/Windows-64-VC10/bugs/modalg_6/bug26064.html [^]

Testing on Linux:
Total MEMORY difference: 94708137 / 94533326 [+0.18%]
Total CPU difference: 52265.21999999937 / 51017.08999999946 [+2.45%]

Testing on Windows:
Total MEMORY difference: 57632861 / 57266778 [+0.64%]
Total CPU difference: 16346.39318389897 / 15810.99775189897 [+3.39%]
(0041084)
git   
2015-05-14 16:35   
Branch CR26064 has been deleted by inv.

SHA-1: 4fcd0f9fbd5fae5d239bea1b6e652bf3551bf582
(0041085)
git   
2015-05-14 16:35   
Branch CR26064_1 has been deleted by inv.

SHA-1: e02bfc0944e37ef28bc570d73e2df0e7b63b9d10