View Issue Details

IDProjectCategoryView StatusLast Update
0031808Open CASCADEOCCT:Visualizationpublic2020-12-02 17:13
ReportervsvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.8.0 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031808: Visualization - NULL dereference in Graphic3d_Structure::IsDisplayed() on Removed presentation
DescriptionFile Graphic3d_Structure.hxx contains the following lines of code:
  //! Returns TRUE if this structure is deleted (after Remove() call).
  Standard_Boolean IsDeleted() const { return myCStructure.IsNull(); }
  
  //! Returns the display indicator for this structure.
  virtual Standard_Boolean IsDisplayed() const { return myCStructure->stick != 0; }


As it is follows from method IsDeleted the field myCStructure can be NULL (if the structure is already deleted). But method IsDisplayed doesn't check this possibility and uses myCStructure as is.
So, in result the code
  if (!base_type::IsDisplayed())

used in PrsMgr_Presentation::display causes crash.
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot required

Relationships

child of 0024704 closedbugmaster Visualization - inherit OpenGl_Structure from Graphic3d_CStructure 

Activities

kgv

2020-09-30 14:32

developer   ~0095494

myCStructure can be created only in constructor and NULLified only within Remove() method - which basically makes Graphic3d_Structure instance a kind of a NULL pointer with no useful methods to call, so that it is expected to be no more used.

There is no problem adding a NULL check to IsDisplayed() method (as well as to IsHighlighted(), IsTransformed(), IsVisible() and similar), but it is unclear in which context and why application calls this method for removed structure.

vsv

2020-10-01 15:11

developer   ~0095527

> why application calls this method for removed structure
Application doesn't call it directly. We have got this exception after call of standard AIS_Shape::Compute for a shape which has removed element. We will continue the investigation why such problem happens.

git

2020-10-28 14:40

administrator   ~0096334

Branch CR31808 has been created by mzernova.

SHA-1: 5f4a4bf5a395b72adfed2b2b9c4f0167b6dea4d8


Detailed log of new commits:

Author: mzernova
Date: Mon Oct 26 17:14:05 2020 +0300

    0031808: Visualization - NULL dereference in Graphic3d_Structure::IsDisplayed() on Removed presentation
    
    Added a NULL check for IsDisplayed(), IsHighlighted(), IsTransformed(), IsVisible(), etc.

git

2020-10-28 16:55

administrator   ~0096340

Branch CR31808 has been updated by mzernova.

SHA-1: 74b57ef23dd74e2d2b3fad75f773e24828272f40


Detailed log of new commits:

Author: mzernova
Date: Wed Oct 28 15:45:19 2020 +0300

    remarks from kgv

git

2020-10-28 16:55

administrator   ~0096341

Branch CR31808_1 has been created by mzernova.

SHA-1: d3c501cc0b025e39c573f69acf799d0711a5230b


Detailed log of new commits:

Author: mzernova
Date: Mon Oct 26 17:14:05 2020 +0300

    0031808: Visualization - NULL dereference in Graphic3d_Structure::IsDisplayed() on Removed presentation
    
    Added a NULL check for IsDisplayed(), IsHighlighted(), IsTransformed(), IsVisible(), etc.

kgv

2020-10-28 17:03

developer   ~0096347

Please raise the patch
- OCCT branch: CR31808_1.

bugmaster

2020-10-31 12:48

administrator   ~0096424

Combination -
OCCT branch : OCCT-750
master SHA - a8b9d7eb277d4ce8949427b7c6ab6af92422ae83
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : OCCT-750 SHA - d1791aa18ab401708974b4c974aba57dc55acaa7
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: 17977.46000000013 / 17994.53000000008 [-0.09%]
Products
Total CPU difference: 12143.270000000102 / 12171.670000000115 [-0.23%]
Windows-64-VC14:
OCCT
Total CPU difference: 19728.796875 / 19728.265625 [+0.00%]
Products
Total CPU difference: 13560.6875 / 13538.390625 [+0.16%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2020-11-05 15:59

administrator   ~0096556

Branch CR31808 has been deleted by inv.

SHA-1: 74b57ef23dd74e2d2b3fad75f773e24828272f40

git

2020-11-05 15:59

administrator   ~0096557

Branch CR31808_1 has been deleted by inv.

SHA-1: d3c501cc0b025e39c573f69acf799d0711a5230b

Related Changesets

occt: master 4065c66c

2020-10-26 14:14:05

mzernova


Committer: bugmaster Details Diff
0031808: Visualization - NULL dereference in Graphic3d_Structure::IsDisplayed() on Removed presentation

Added a NULL check for IsDisplayed(), IsHighlighted(), IsTransformed(), IsVisible(), etc.
Affected Issues
0031808
mod - src/Graphic3d/Graphic3d_Structure.hxx Diff File

Issue History

Date Modified Username Field Change
2020-09-30 13:04 vsv New Issue
2020-09-30 13:04 vsv Assigned To => kgv
2020-09-30 14:32 kgv Note Added: 0095494
2020-09-30 14:33 kgv Severity major => minor
2020-09-30 14:33 kgv Summary Code in Graphic3d_Structure.hxx produces crash. => Visualization - NULL dereference in Graphic3d_Structure::IsDisplayed() on Removed presentation
2020-09-30 14:36 kgv Product Version 7.5.0 => 6.8.0
2020-09-30 14:37 kgv Relationship added child of 0024704
2020-09-30 14:37 kgv Assigned To kgv => mzernova
2020-09-30 14:37 kgv Status new => assigned
2020-09-30 14:47 kgv Description Updated
2020-10-01 15:11 vsv Note Added: 0095527
2020-10-28 14:40 git Note Added: 0096334
2020-10-28 14:44 mzernova Assigned To mzernova => kgv
2020-10-28 14:44 mzernova Status assigned => resolved
2020-10-28 14:44 mzernova Steps to Reproduce Updated
2020-10-28 14:54 kgv Assigned To kgv => mzernova
2020-10-28 14:54 kgv Status resolved => assigned
2020-10-28 14:54 kgv Target Version 7.6.0 => 7.5.0
2020-10-28 16:55 git Note Added: 0096340
2020-10-28 16:55 git Note Added: 0096341
2020-10-28 17:01 mzernova Assigned To mzernova => kgv
2020-10-28 17:01 mzernova Status assigned => resolved
2020-10-28 17:03 kgv Assigned To kgv => bugmaster
2020-10-28 17:03 kgv Status resolved => reviewed
2020-10-28 17:03 kgv Note Added: 0096347
2020-10-31 12:48 bugmaster Note Added: 0096424
2020-10-31 12:48 bugmaster Status reviewed => tested
2020-10-31 12:52 bugmaster Test case number => Not required
2020-10-31 12:54 bugmaster Changeset attached => occt master 4065c66c
2020-10-31 12:54 bugmaster Status tested => verified
2020-10-31 12:54 bugmaster Resolution open => fixed
2020-11-05 15:59 git Note Added: 0096556
2020-11-05 15:59 git Note Added: 0096557
2020-12-02 16:22 emo Fixed in Version => 7.5.0
2020-12-02 17:13 emo Status verified => closed