MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031808Open CASCADE[OCCT] OCCT:Visualizationpublic2020-09-30 13:042020-12-02 17:13
Reportervsv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 7.5.0Fixed in Version[OCCT] 7.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
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.
(0096424)
bugmaster (administrator)
2020-10-31 12:48

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
(0096556)
git (administrator)
2020-11-05 15:59

Branch CR31808 has been deleted by inv.

SHA-1: 74b57ef23dd74e2d2b3fad75f773e24828272f40
(0096557)
git (administrator)
2020-11-05 15:59

Branch CR31808_1 has been deleted by inv.

SHA-1: d3c501cc0b025e39c573f69acf799d0711a5230b

- Related Changesets
occt: master 4065c66c
Timestamp: 2020-10-26 14:14:05
Author: 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.
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 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
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


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker