MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023504Community[OCCT] OCCT:Modeling Algorithmspublic2012-11-01 15:062012-11-16 13:18
ReporterVitezslav Zajic 
Assigned ToVitezslav Zajic 
PrioritynormalSeveritycrash 
StatusclosedResolutionfixed 
PlatformWindowsOSVC++ 2010OS Version32 bit
Product Version[OCCT] 6.5.3 
Target Version[OCCT] 6.5.4Fixed in Version[OCCT] 6.5.4 
Summary0023504: The function Adaptor3d_TopolTool::BSplSamplePnts leaves uninitialized items in myUPars and myVPars arrays
DescriptionThe function Adaptor3d_TopolTool::BSplSamplePnts leaves uninitialized items in myUPars and myVPars arrays, which are later used by IntPolyh_MaillageAffinage::FillArrayOfPnt function and this triggers an OuOfRange exception in Geom_BSplineSurface::ValidateCache (see attached screenshot of the debugger).

The following code (part of Adaptor3d_TopolTool::BSplSamplePnts function) creates an array myUPars of the size myNbSamplesU, but if some item in anUFlg array is set to false, it does not initializes all of the items in myUPars:

  //
  // U
  bFlag=(myNbSamplesU < theNUmin);
  if (bFlag) {
    myNbSamplesU=nbsu;
  }
  //
  myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
  //
  for(j = 0, i = 1; i <= nbsu; ++i) {
    if (bFlag) {
       myUPars->SetValue(i,anUPars(i));
    }
    else {
      if(anUFlg(i)) {
    ++j;
    myUPars->SetValue(j,anUPars(i));
      }
    }
  }
  //

I've replaced this code with the following one that solved the problem for me:

  //
  // U
  myNbSamplesU = nbsu;
  if (bFlag)
  {
    myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
    for (i = 1; i <= nbsu; ++i)
    {
      myUPars->SetValue(i,anUPars(i));
    }
  }
  else
  {
    for (i = 1; i <= nbsu; ++i)
    {
      if (!anUFlg(i))
      {
        --myNbSamplesU;
      }
    }
    myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
    for(j = 0, i = 1; i <= nbsu; ++i)
    {
      if(anUFlg(i))
      {
          ++j;
          myUPars->SetValue(j, anUPars(i));
      }
    }
  }
  //

The same applies for V parameters.
TagsNo tags attached.
Test case number
Attached Filespng file icon OCCT crash.png (153,404 bytes) 2012-11-01 15:06

- Relationships

-  Notes
(0022089)
jgv (developer)
2012-11-02 18:09

This bug has been fixed by the patch to 23472

- Issue History
Date Modified Username Field Change
2012-11-01 15:06 Vitezslav Zajic New Issue
2012-11-01 15:06 Vitezslav Zajic Assigned To => jgv
2012-11-01 15:06 Vitezslav Zajic File Added: OCCT crash.png
2012-11-01 15:32 abv Target Version => 6.5.4
2012-11-02 18:09 jgv Note Added: 0022089
2012-11-02 18:09 jgv Status new => resolved
2012-11-02 18:09 jgv Assigned To jgv => abv
2012-11-08 09:30 abv Relationship added related to 0023472
2012-11-08 09:50 abv Assigned To abv => Vitezslav Zajic
2012-11-08 09:50 abv Status resolved => reviewed
2012-11-08 09:52 abv Relationship replaced duplicate of 0023472
2012-11-08 09:52 abv Status reviewed => verified
2012-11-08 09:52 abv Resolution open => fixed
2012-11-08 09:52 abv Changeset attached => occt master 07782e0c
2012-11-16 13:13 bugmaster Fixed in Version => 6.5.4
2012-11-16 13:18 bugmaster Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker