View Issue Details

IDProjectCategoryView StatusLast Update
0022782Open CASCADEOCCT:Visualizationpublic2012-03-29 17:26
ReportersanAssigned Tobugmaster  
Status closedResolutionfixed 
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:


Meanwhile, the C++ standard ( 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


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 



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.


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.

2san, please review this patch.


2012-02-21 13:36

developer   ~0019698

The SVN branch reviewed without remarks, ready for testing.


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


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


Related Changesets

occt: master 529afc1a

2012-02-22 12:55:05


Committer: bugmaster Details Diff
0022782: Uninitialized global variable used in conditionals in OpenGl package Affected Issues
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