View Issue Details

IDProjectCategoryView StatusLast Update
0023504CommunityOCCT:Modeling Algorithmspublic2012-11-16 13:18
ReporterVitezslav Zajic Assigned ToVitezslav Zajic  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2010 
Product Version6.5.3 
Target Version6.5.4Fixed in Version6.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 Files

  • OCCT crash.png (153,404 bytes)

Activities

Vitezslav Zajic

2012-11-01 15:06

reporter  

OCCT crash.png (153,404 bytes)

jgv

2012-11-02 18:09

developer   ~0022089

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:50 abv Assigned To abv => Vitezslav Zajic
2012-11-08 09:50 abv Status resolved => reviewed
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