MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030202Community[OCCT] OCCT:Modeling Algorithmspublic2018-10-04 22:462018-10-14 13:56
Reportergalbramc 
Assigned Toapn 
PrioritynormalSeveritycrash 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030202: IntPatch_WLineTool::JoinWLines array out of bounds
DescriptionaWLine2 inside IntPatch_WLineTool::JoinWLines may sometimes be length 1, but lines 1489 and 1510 of IntPatch/IntPatch_WLineTool.cxx assume that aWLine2 is at least length 2. The following patch avoids the array out of bound error, but might not function correctly:

Index: src/IntPatch/IntPatch_WLineTool.cxx
===================================================================
--- src/IntPatch/IntPatch_WLineTool.cxx (revision 1)
+++ src/IntPatch/IntPatch_WLineTool.cxx (working copy)
@@ -1485,9 +1485,9 @@
         if (CheckArgumentsToJoin(theS1, theS2, aPntFWL1, aMinRad))
         {
           const Standard_Boolean isFM = (aSqDistF < aSqDistL);
- const IntSurf_PntOn2S& aPt1 = aWLine1->Point(2);
- const IntSurf_PntOn2S& aPt2 = isFM ? aWLine2->Point(2) :
- aWLine2->Point(aNbPntsWL2 - 1);
+ const IntSurf_PntOn2S& aPt1 = aWLine1->Point(Min(2,aNbPntsWL1));
+ const IntSurf_PntOn2S& aPt2 = isFM ? aWLine2->Point(Min(2,aNbPntsWL2)) :
+ aWLine2->Point(Max(1,aNbPntsWL2 - 1));
 
           if (!IsSeamOrBound(aPt1, aPt2, aPntFWL1,
                               anArrPeriods, anArrFBonds, anArrLBonds))
@@ -1506,9 +1506,9 @@
         if (CheckArgumentsToJoin(theS1, theS2, aPntLWL1, aMinRad))
         {
           const Standard_Boolean isFM = (aSqDistF < aSqDistL);
- const IntSurf_PntOn2S& aPt1 = aWLine1->Point(aNbPntsWL1 - 1);
- const IntSurf_PntOn2S& aPt2 = isFM ? aWLine2->Point(2) :
- aWLine2->Point(aNbPntsWL2 - 1);
+ const IntSurf_PntOn2S& aPt1 = aWLine1->Point(Max(1,aNbPntsWL1 - 1));
+ const IntSurf_PntOn2S& aPt2 = isFM ? aWLine2->Point(Min(2,aNbPntsWL2)) :
+ aWLine2->Point(Max(1,aNbPntsWL2 - 1));
 
           if (!IsSeamOrBound(aPt1, aPt2, aPntLWL1,
                               anArrPeriods, anArrFBonds, anArrLBonds))
Steps To ReproduceRun the attached code.
TagsNo tags attached.
Test case numberbugs/modalg_7/bug30202_1, bug30202_2
Attached Filestgz file icon JoinWLines_OutOfBounds.tgz (27,338 bytes) 2018-10-04 22:46

- Relationships

-  Notes
(0079729)
git (administrator)
2018-10-05 15:40

Branch CR30202 has been created by nbv.

SHA-1: 7d58bcfd75e3a8e7bacbaef7df497e6c08945360


Detailed log of new commits:

Author: nbv
Date: Fri Oct 5 10:50:51 2018 +0300

    0030202: IntPatch_WLineTool::JoinWLines array out of bounds
    
    The main idea of the fix is that the creation of WLine with one point is forbidden.
(0079778)
git (administrator)
2018-10-08 11:11

Branch CR30202 has been updated forcibly by nbv.

SHA-1: 1dad93ab4dba53fadd39eda395b2a47939e18d43
(0079785)
nbv (developer)
2018-10-08 13:10

Dear Mikhail,

Please review the branch CR30202.

Test results are here: http://jenkins-test-12.nnov.opencascade.com/view/CR30202-master_NBV/view/COMPARE/ [^]
(0079788)
msv (developer)
2018-10-08 15:09

Reviewed.
(0079790)
git (administrator)
2018-10-08 15:12

Branch CR30202 has been updated by nbv.

SHA-1: 5c58946f4bdba922f1827b0e08f1ab010e863722


Detailed log of new commits:

Author: nbv
Date: Mon Oct 8 15:11:25 2018 +0300

    # Insignificant correction in the code

(0079792)
bugmaster (administrator)
2018-10-08 16:11

Combination -
OCCT branch : CR30202 SHA - 1dad93ab4dba53fadd39eda395b2a47939e18d43
Products branch : master SHA - fa672296ba29ad12e59ba21c0c612c412b808a5d
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: 17381.879999999866 / 17385.999999999854 [-0.02%]
Products
Total CPU difference: 7421.370000000055 / 7445.680000000064 [-0.33%]
Windows-64-VC14:
OCCT
Total CPU difference: 17501.861390698596 / 17457.853508598404 [+0.25%]
Products
Total CPU difference: 8355.741162099994 / 8343.292282299992 [+0.15%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0079935)
git (administrator)
2018-10-14 13:56

Branch CR30202 has been deleted by inv.

SHA-1: 5c58946f4bdba922f1827b0e08f1ab010e863722

- Related Changesets
occt: master dcd768a4
Timestamp: 2018-10-05 07:50:51
Author: nbv
Committer: apn
Details ] Diff ]
0030202: IntPatch_WLineTool::JoinWLines array out of bounds

The main idea of the fix is that the creation of WLine with one point is forbidden.
mod - src/IntPatch/IntPatch_ImpImpIntersection_4.gxx Diff ] File ]
add - tests/bugs/modalg_7/bug30202_1 Diff ] File ]
add - tests/bugs/modalg_7/bug30202_2 Diff ] File ]

- Issue History
Date Modified Username Field Change
2018-10-04 22:46 galbramc New Issue
2018-10-04 22:46 galbramc Assigned To => msv
2018-10-04 22:46 galbramc File Added: JoinWLines_OutOfBounds.tgz
2018-10-04 23:52 msv Assigned To msv => nbv
2018-10-04 23:52 msv Status new => assigned
2018-10-04 23:52 msv Target Version => 7.4.0*
2018-10-05 15:40 git Note Added: 0079729
2018-10-08 11:11 git Note Added: 0079778
2018-10-08 13:10 nbv Note Added: 0079785
2018-10-08 13:10 nbv Assigned To nbv => msv
2018-10-08 13:10 nbv Status assigned => resolved
2018-10-08 15:09 msv Note Added: 0079788
2018-10-08 15:09 msv Assigned To msv => bugmaster
2018-10-08 15:09 msv Status resolved => reviewed
2018-10-08 15:12 git Note Added: 0079790
2018-10-08 16:09 bugmaster Test case number => bugs/modalg_7/bug30202_1, bug30202_2
2018-10-08 16:11 bugmaster Note Added: 0079792
2018-10-08 16:11 bugmaster Status reviewed => tested
2018-10-13 16:01 apn Changeset attached => occt master dcd768a4
2018-10-13 16:01 apn Assigned To bugmaster => apn
2018-10-13 16:01 apn Status tested => verified
2018-10-13 16:01 apn Resolution open => fixed
2018-10-14 13:56 git Note Added: 0079935


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker