MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031808Open CASCADE[OCCT] OCCT:Visualizationpublic2020-09-30 13:042020-10-28 17:03
Reportervsv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusreviewedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 7.5.0Fixed in Version 
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 number
Attached Files

- Relationships
child of 0024704closedbugmaster Visualization - inherit OpenGl_Structure from Graphic3d_CStructure 

-  Notes
(0095494)
kgv (developer)
2020-09-30 14:32

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.
(0095527)
vsv (developer)
2020-10-01 15:11

> 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.
(0096334)
git (administrator)
2020-10-28 14:40

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.
(0096340)
git (administrator)
2020-10-28 16:55

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

(0096341)
git (administrator)
2020-10-28 16:55

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.
(0096347)
kgv (developer)
2020-10-28 17:03

Please raise the patch
- OCCT branch: CR31808_1.

- 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 View Revisions
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 View Revisions
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


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker