View Issue Details

IDProjectCategoryView StatusLast Update
0022782Open CASCADEOCCT:Visualizationpublic2012-03-29 17:26
ReportersanAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformAOSL 
Product Version6.5.2 
Target Version6.5.3Fixed in Version6.5.3 
Summary0022782: Uninitialized global variable used in conditionals in OpenGl package
DescriptionOpenGl_togl_redraw.cxx defines "g_fBitmap" global variable without initializing it explicitly:

GLboolean g_fBitmap;

This variable's value is then checked in several other source files in OpenGl package:

OpenGl_indexpolygons.cxx
OpenGl_PrimitiveArray.cxx
OpenGl_qstrip.cxx
OpenGl_tmesh.cxx

Meanwhile, the C++ standard (http://info.nnov.opencascade.com/~det/doc/Books/cpp/cpp_iso.pdf) claims that "The memory occupied by any object of static storage duration shall be zero-initialized at program startup before any other initialization takes place." (see p.8.5, clause 6).

Thus this is rather the problem of the source code readability and should not result in any run-time problems.

However, as g_fBitmap is not assigned any non-zero value any longer, it is necessary to remove both this variable and the code pieces corresponding to its non-zero value.
TagsNo tags attached.
Test case numberTest case is not required

Relationships

related to 0022819 closedbugmaster Open CASCADE Redesign of OpenGl driver 
related to 0021902 closedkgv Open CASCADE Improve by capability to make off-screen snapshots of 2d, 3d, and axo viewers 
related to 0022337 closedbugmaster Community V3d_View::Print crashes in OCCT 6.5.0 

Activities

kgv

2012-02-20 17:14

developer   ~0019682

g_fBitmap variable was used to work with non-sharable context created for off-screen rendering to WinAPI bitmap. Since off-screen rendering code was changed to use FBO these workarounds become useless (moreover them were incomplete).

The usage of g_fBitmap in rendering code was removed in 0022819 bug.
However values OPENGL_NS_ISBITMAP, OCC_REDRAW_BITMAP and OCC_REDRAW_WINDOW still remain but meaningless and should be removed too.

kgv

2012-02-21 10:49

developer   ~0019692

In bug branch:
 - Removed unused structures CALL_DEF_BITMAP (and field CALL_DEF_VIEW.DefBitmap).
Direct rendering to WinAPI bitmap no more supported.
 - Removed unused values OCC_REDRAW_WINDOW, OCC_REDRAW_WINDOWAREA, OCC_REDRAW_BITMAP, OPENGL_NS_ISBITMAP.

2san, please review this patch.

san

2012-02-21 13:36

developer   ~0019698

The SVN branch reviewed without remarks, ready for testing.

mkv

2012-02-22 14:53

tester   ~0019730

Dear BugMaster,
Workbench KAS:dev:mkv-22782-occt was created from SVN branch http://svn/svn/occt/branches/OCC22782
(and mkv-22782-products from trunk) and compiled on Linux platform.

There are not regressions in mkv-22782-products regarding to KAS:dev:products--opt

See results in /QADisk/occttests/results/KAS/dev/mkv-22782-products_21022012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120217-opt_17022012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification

bugmaster

2012-02-22 16:56

administrator   ~0019743

Integrated into trunk of occt repository

Date: 2012-02-22 16:55:05 +0400 (Wed, 22 Feb 2012)
New Revision: 10602

Modified:
   trunk/src/Aspect/Aspect_GraphicCallbackProc.hxx
   trunk/src/InterfaceGraphic/InterfaceGraphic_Aspect.hxx
   trunk/src/InterfaceGraphic/InterfaceGraphic_Visual3d.hxx
   trunk/src/OpenGl/OpenGl_GraphicDriver_7.cxx
   trunk/src/OpenGl/OpenGl_NamedStatus.hxx
   trunk/src/OpenGl/OpenGl_View_2.cxx
   trunk/src/OpenGl/OpenGl_Workspace_2.cxx
   trunk/src/Visual3d/Visual3d_View.cxx

Related Changesets

occt: master 529afc1a

2012-02-22 12:55:05

kgv


Committer: bugmaster Details Diff
0022782: Uninitialized global variable used in conditionals in OpenGl package Affected Issues
0022782
mod - src/Aspect/Aspect_GraphicCallbackProc.hxx Diff File
mod - src/InterfaceGraphic/InterfaceGraphic_Aspect.hxx Diff File
mod - src/InterfaceGraphic/InterfaceGraphic_Visual3d.hxx Diff File
mod - src/OpenGl/OpenGl_GraphicDriver_7.cxx Diff File
mod - src/OpenGl/OpenGl_NamedStatus.hxx Diff File
mod - src/OpenGl/OpenGl_View_2.cxx Diff File
mod - src/OpenGl/OpenGl_Workspace_2.cxx Diff File
mod - src/Visual3d/Visual3d_View.cxx Diff File

Issue History

Date Modified Username Field Change
2011-10-26 17:03 san New Issue
2011-10-26 17:03 san Assigned To => san
2011-10-26 17:33 san Summary Uninitialized global variable used in conditionals => Uninitialized global variable used in conditionals in OpenGl package
2011-11-07 11:38 san Assigned To san => dln
2011-11-07 11:38 san Status new => assigned
2012-02-10 10:59 san Assigned To dln => san
2012-02-10 11:00 san Relationship added related to 0022819
2012-02-20 17:14 kgv Note Added: 0019682
2012-02-21 10:25 kgv Relationship added related to 0021902
2012-02-21 10:41 kgv Relationship added related to 0022337
2012-02-21 10:49 kgv Note Added: 0019692
2012-02-21 10:49 kgv Status assigned => resolved
2012-02-21 13:36 san Note Added: 0019698
2012-02-21 13:36 san Assigned To san => bugmaster
2012-02-21 13:36 san Status resolved => reviewed
2012-02-21 16:15 mkv Assigned To bugmaster => mkv
2012-02-22 14:53 mkv Note Added: 0019730
2012-02-22 14:54 mkv Test case number => Test case is not required
2012-02-22 14:54 mkv Assigned To mkv => bugmaster
2012-02-22 14:54 mkv Status reviewed => tested
2012-02-22 16:56 bugmaster Note Added: 0019743
2012-02-22 16:56 bugmaster Status tested => verified
2012-02-22 16:56 bugmaster Resolution open => fixed
2012-02-22 16:56 bugmaster Assigned To bugmaster => san
2012-03-29 17:26 bugmaster Changeset attached => occt master 529afc1a