View Issue Details

IDProjectCategoryView StatusLast Update
0029478CommunityOCCT:Data Exchangepublic2021-09-25 09:44
Reporterstefan Assigned Tosmoskvin  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformVisual Studio 2017 32 bitOSWindows 
Product Version7.1.0 
Fixed in Version7.6.0 
Summary0029478: Crash because bSplineSurfaceWithKnots is NULL
DescriptionI created a simplified STP file(see attachment) using WorkXplore 2018.1.0 x64.

The crash happens here:

BS = BSR->BSplineSurfaceWithKnots(); // returns NULL
...
const Standard_Integer UDeg = BS->UDegree(); // crashes here


Here is the full code:


Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeom_BSplineSurface)& SS)
{
  Standard_Integer i, j;
  Handle(StepGeom_BSplineSurfaceWithKnots) BS;
  Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSR;

  if (SS->
      IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface))) {
    BSR =
      Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)
    ::DownCast(SS);
    BS = BSR->BSplineSurfaceWithKnots();
  }
  else
    BS = Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS);

  const Standard_Integer UDeg = BS->UDegree();
...
Steps To ReproduceThis is how I'm using the Step Reader. The software crashes in TransferRoots() everytime.


// Remove std::cout from the printer list of OpenCASCADE
// More precisely, remove ALL printers from the list.
Message::DefaultMessenger()->ChangePrinters().Clear();

// Install our own error printer
std::string error_message;
Message::DefaultMessenger()->AddPrinter(Handle_Message_Printer(new STEPErrorPrinter(&error_message, STEPErrorLevel::FAILURE)));

auto reader = STEPControl_Reader();
reader.ReadFile(d_filename.c_str());
reader.TransferRoots();
TagsNo tags attached.
Test case numberbugs step bug29478

Attached Files

  • Toy Test 6 d_ok rough_no_groups.stp (10,600 bytes)

Activities

stefan

2018-02-03 04:08

reporter  

Toy Test 6 d_ok rough_no_groups.stp (10,600 bytes)

git

2021-09-17 18:58

administrator   ~0104172

Branch CR29478 has been created by asemenov_ext.

SHA-1: 7e435b36b08459ee2643be1a06af4508ddfd1740


Detailed log of new commits:

Author: asemenov
Date: Fri Sep 17 18:46:43 2021 +0300

    0029478: Crash because bSplineSurfaceWithKnots is NULL.
    
    Modified the method void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep
    Added processing B spline surface with knots and rational B spline surface with empty data in the name field
    Added test

git

2021-09-20 11:10

administrator   ~0104230

Branch CR29478 has been updated forcibly by ika.

SHA-1: a53900800d09a79e659e0bc65719bf0d2428f520

asemenov_ext

2021-09-20 18:22

developer   ~0104240

When reading the empty namе field of the B_Spline_Surface_With_Knots entity with Rational_B_Spline_Surface from the STEP file, then an empty entity with no data is created.

asemenov_ext

2021-09-20 18:27

developer   ~0104242

Dear ika, please review branch CR29478

ika

2021-09-20 18:59

developer   ~0104244

No remarks.
Tests are OK http://jenkins-test-occt/view/CR29478-master-asemenov_ext/

Dear bugmaster,

please integrate:
OCCT - CR29478
Products - NOT

kgv

2021-09-24 19:39

developer   ~0104339

Artem, please print bug description using "puts" instead of a Tcl-comment in future patches, so that it will be available in HTML log.

+# Crash because bSplineSurfaceWithKnots is NULL

smoskvin

2021-09-25 09:05

administrator   ~0104353

Combination -
OCCT branch : IR-2021-09-24
master SHA - 3be25c11705b931ff623f372a24e3e1b2203899c
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-09-24 SHA - 87b937b1aaab0e7b9de6bee9b334ae2694f02413
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: 17446.850000000457 / 17398.820000000545 [+0.28%]
Products
---
Windows-64-VC14:
OCCT
Total CPU difference: 19308.25 / 19330.984375 [-0.12%]
Products
---


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-09-25 09:44

administrator   ~0104360

Branch CR29478 has been deleted by mnt.

SHA-1: a53900800d09a79e659e0bc65719bf0d2428f520

Related Changesets

occt: master 5dd92c39

2021-09-17 15:46:43

asemenov


Committer: smoskvin Details Diff
0029478: Crash because bSplineSurfaceWithKnots is NULL.

Modified the method void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep
Added processing B spline surface with knots and rational B spline surface with empty data in the name field
Added test
Affected Issues
0029478
mod - src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx Diff File
add - tests/bugs/step/bug29478 Diff File

Issue History

Date Modified Username Field Change
2018-02-03 04:08 stefan New Issue
2018-02-03 04:08 stefan Assigned To => gka
2018-02-03 04:08 stefan File Added: Toy Test 6 d_ok rough_no_groups.stp
2021-09-17 16:19 ika Assigned To gka => asemenov_ext
2021-09-17 16:19 ika Status new => assigned
2021-09-17 18:58 git Note Added: 0104172
2021-09-20 11:10 git Note Added: 0104230
2021-09-20 18:22 asemenov_ext Test case number => bugs step bug29478
2021-09-20 18:22 asemenov_ext Note Added: 0104240
2021-09-20 18:27 asemenov_ext Note Added: 0104242
2021-09-20 18:27 asemenov_ext Assigned To asemenov_ext => ika
2021-09-20 18:27 asemenov_ext Status assigned => resolved
2021-09-20 18:59 ika Note Added: 0104244
2021-09-20 18:59 ika Assigned To ika => bugmaster
2021-09-20 18:59 ika Status resolved => reviewed
2021-09-24 19:39 kgv Note Added: 0104339
2021-09-25 09:05 smoskvin Note Added: 0104353
2021-09-25 09:05 smoskvin Status reviewed => tested
2021-09-25 09:22 smoskvin Changeset attached => occt master 5dd92c39
2021-09-25 09:22 smoskvin Assigned To bugmaster => smoskvin
2021-09-25 09:22 smoskvin Status tested => verified
2021-09-25 09:22 smoskvin Resolution open => fixed
2021-09-25 09:44 git Note Added: 0104360