View Issue Details

IDProjectCategoryView StatusLast Update
0030176CommunityOCCT:Modeling Algorithmspublic2019-01-23 19:14
Reportergalbramc Assigned Tobugmaster  
PrioritynormalSeverityblock 
Status closedResolutionfixed 
Product Version7.3.0 
Target Version7.4.0Fixed in Version7.4.0 
Summary0030176: Modeling Algorithms - Infinite loop in IntWalk_PWalking::Perform()
DescriptionThe do loop on line 1003 of IntWalk_PWalking.cxx gets stuck in an infinite loop. The loop follows the pattern explained on line 1171, i.e.:
              // In order to avoid cyclic changes
              // (PasTropGrand --> Decrease step --> 
              // StepTooSmall --> Increase step --> PasTropGrand...)
              // nullify LevelOfIterWithoutAppend only if the condition
              // is satisfied:
              if (aPrevStatus != IntWalk_PasTropGrand)
                LevelOfIterWithoutAppend = 0;


However, the same logic appears to be missing on line 1098. The following patch seems to resolve the issue:

Index: src/IntWalk/IntWalk_PWalking.cxx
===================================================================
--- src/IntWalk/IntWalk_PWalking.cxx	(revision 1)
+++ src/IntWalk/IntWalk_PWalking.cxx	(working copy)
@@ -1098,7 +1098,14 @@
                 if(aDelta > Epsilon(pasInit[i]))
                 {
                   pasInit[i] -= aDelta;
-                  LevelOfIterWithoutAppend=0;
+
+                  // In order to avoid cyclic changes
+                  // (PasTropGrand --> Decrease step -->
+                  // StepTooSmall --> Increase step --> PasTropGrand...)
+                  // nullify LevelOfIterWithoutAppend only if the condition
+                  // is satisfied:
+                  if (aPrevStatus != IntWalk_StepTooSmall)
+                    LevelOfIterWithoutAppend=0;
                 }
               }
             }

Steps To Reproducerestore [locate_data_file bug30176_shape.brep] sshh
explode sshh e

blend result sshh 0.1 sshh_36 0.1 sshh_36 0.1 sshh_38 0.1 sshh_71 0.1 sshh_72 0.1 sshh_73
Additional information
and documentation updates
We are using OpenCASCADE as the CAD kernel for our software (acdl.mit.edu/ESP). I am happy to help explain how to compile and run an ESP test case that gets stuck in an infinite loop. I unfortunately am not familiar enough with the OpenCASCADE testing to generate an OCCT test that will reproduce the issue.
TagsNo tags attached.
Test case numberbugs/modalg_7/bug30176

Attached Files

  • infinite_loop.tgz (5,389 bytes)
  • bug30176_shape.brep (25,607 bytes)

Activities

msv

2018-10-02 09:38

developer   ~0079566

All we need to reproduce the problem is knowledge of which upper level OCCT algorithm do you call and all input data to it. Each shape should be available in BRep format written by the method BRepTools::Write().

msv

2018-10-02 09:42

developer   ~0079568

Please provide input shapes and may be a piece of code reproducing the problem, and then reassign again to me.

galbramc

2018-10-02 19:23

reporter  

infinite_loop.tgz (5,389 bytes)

galbramc

2018-10-02 19:25

reporter   ~0079620

I was able to crate a little program what gets stuck in the infinite loop. Please let know if you have questions about it.

msv

2018-10-03 09:38

developer   ~0079626

Dear Nikolay, please take care of further processing.

nbv

2018-10-03 09:59

developer  

bug30176_shape.brep (25,607 bytes)

git

2018-10-03 17:03

administrator   ~0079648

Branch CR30176 has been created by nbv.

SHA-1: 0702cb07eb9a6353db7d4b5f686e31e5501b2a79


Detailed log of new commits:

Author: nbv
Date: Wed Oct 3 17:02:44 2018 +0300

    0030176: Modeling Algorithms - Infinite loop in IntWalk_PWalking::Perform()
    
    Currently resetting of counter LevelOfIterWithoutAppend is enabled only if additional iterations have taken some positive effect.

git

2018-10-04 09:46

administrator   ~0079664

Branch CR30176 has been updated by nbv.

SHA-1: fc7df137d2409cda5864cbeabf67372265daa36c


Detailed log of new commits:

Author: nbv
Date: Thu Oct 4 09:45:45 2018 +0300

    # Small correction in the new test case.

nbv

2018-10-04 09:51

developer   ~0079665

Dear Mikhail,

Please review the current state of CR30176 branch.

Test results are here: http://jenkins-test-12.nnov.opencascade.com/view/CR30176-master_NBV/

msv

2018-10-04 10:48

developer   ~0079669

Reviewed.

bugmaster

2018-10-04 18:09

administrator   ~0079702

Combination -
OCCT branch : CR30176 SHA - 0702cb07eb9a6353db7d4b5f686e31e5501b2a79
Products branch : master SHA - bdd0353fc53f9279cf9520705239af63f757c03a
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: 17451.459999999814 / 17401.889999999843 [+0.28%]
Products
Total CPU difference: 7442.740000000059 / 7431.600000000062 [+0.15%]
Windows-64-VC14:
OCCT
Total CPU difference: 17439.148988698547 / 17485.309684598556 [-0.26%]
Products
Total CPU difference: 8325.211766400007 / 8352.574341799986 [-0.33%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2018-10-07 12:43

administrator   ~0079749

Branch CR30176 has been deleted by inv.

SHA-1: fc7df137d2409cda5864cbeabf67372265daa36c

Related Changesets

occt: master 521648ce

2018-10-03 14:02:44

nbv


Committer: bugmaster Details Diff
0030176: Modeling Algorithms - Infinite loop in IntWalk_PWalking::Perform()

Currently resetting of counter LevelOfIterWithoutAppend is enabled only if additional iterations have taken some positive effect.
Affected Issues
0030176
mod - src/IntWalk/IntWalk_PWalking.cxx Diff File
add - tests/perf/modalg/bug30176 Diff File

Issue History

Date Modified Username Field Change
2018-09-28 17:49 galbramc New Issue
2018-09-28 17:49 galbramc Assigned To => kgv
2018-09-28 18:54 kgv Assigned To kgv => msv
2018-09-28 18:54 kgv Category OCCT:Coding => OCCT:Modeling Algorithms
2018-09-28 18:54 kgv Summary Infinite loop in IntWalk_PWalking::Perform => Modeling Algorithms - Infinite loop in IntWalk_PWalking::Perform()
2018-09-28 18:54 kgv Description Updated
2018-10-02 09:38 msv Note Added: 0079566
2018-10-02 09:42 msv Note Added: 0079568
2018-10-02 09:42 msv Assigned To msv => galbramc
2018-10-02 09:42 msv Status new => feedback
2018-10-02 19:23 galbramc File Added: infinite_loop.tgz
2018-10-02 19:25 galbramc Note Added: 0079620
2018-10-02 19:25 galbramc Assigned To galbramc => msv
2018-10-03 09:38 msv Note Added: 0079626
2018-10-03 09:38 msv Assigned To msv => nbv
2018-10-03 09:38 msv Status feedback => assigned
2018-10-03 09:58 nbv Steps to Reproduce Updated
2018-10-03 09:58 nbv Additional Information Updated
2018-10-03 09:59 nbv File Added: bug30176_shape.brep
2018-10-03 17:03 git Note Added: 0079648
2018-10-04 09:46 git Note Added: 0079664
2018-10-04 09:51 nbv Note Added: 0079665
2018-10-04 09:51 nbv Assigned To nbv => msv
2018-10-04 09:51 nbv Status assigned => resolved
2018-10-04 10:48 msv Note Added: 0079669
2018-10-04 10:48 msv Assigned To msv => bugmaster
2018-10-04 10:48 msv Status resolved => reviewed
2018-10-04 18:08 bugmaster Test case number => bugs/modalg_7/bug30176
2018-10-04 18:09 bugmaster Note Added: 0079702
2018-10-04 18:09 bugmaster Status reviewed => tested
2018-10-06 19:15 bugmaster Changeset attached => occt master 521648ce
2018-10-06 19:15 bugmaster Status tested => verified
2018-10-06 19:15 bugmaster Resolution open => fixed
2018-10-07 12:43 git Note Added: 0079749
2018-10-12 20:41 abv Target Version => 7.4.0