View Issue Details

IDProjectCategoryView StatusLast Update
0024590CommunityOCCT:Visualizationpublic2014-11-11 12:51
ReporterPawel Assigned Toapn  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2012 
Product Version6.7.0 
Target Version6.8.0Fixed in Version6.8.0 
Summary0024590: Crash when processing OpenGl_BndBoxPrs objects
DescriptionIn OpenGL_SceneGeometry.cxx in the method:

Standard_Boolean IsRaytracedElement (const OpenGl_ElementNode* theNode)

on line 714 there is a cast:

OpenGl_PrimitiveArray* anArray = dynamic_cast< OpenGl_PrimitiveArray* > (theNode->elem);

The result is not checked against NULL. Although NULL is possible when theNode->elem is pointer to OpenGl_BndBoxPrs, which is not inherited from OpenGl_PrimitiveArray.


The code below called in

MyAISObject::Compute(const Handle_PrsMgr_PresentationManager3d& aPresentationManager,
                             const Handle_Prs3d_Presentation& aPresentation,
                             const Standard_Integer aMode)

causes crash during an attempt to highlight it.

Handle(Graphic3d_Structure) aStruct = Handle(Graphic3d_Structure)::DownCast(aPresentation);
aStruct->SetHighlightColor(HighlightColor);
aStruct->Highlight(Aspect_TOHM_BOUNDBOX);

Here is the call stack.

TKOpenGl.dll!OpenGl_PrimitiveArray::PArray() Line 48
TKOpenGl.dll!OpenGl_Raytrace::IsRaytracedElement(const OpenGl_ElementNode * theNode) Line 715
TKOpenGl.dll!OpenGl_Group::AddElement(const TelType theType, OpenGl_Element * theElem) Line 176
TKOpenGl.dll!OpenGl_Structure::SetHighlightBox(const Handle_OpenGl_Context & theGlCtx, const CALL_DEF_BOUNDBOX & theBoundBox) Line 286
TKOpenGl.dll!OpenGl_GraphicDriver::BoundaryBox(const Graphic3d_CStructure & theCStructure, const unsigned int toCreate) Line 76
TKV3d.dll!Graphic3d_Structure::GraphicHighlight(const Aspect_TypeOfHighlightMethod AMethod) Line 2328
TagsNo tags attached.
Test case numberNot needed

Activities

kgv

2014-02-03 15:56

developer   ~0027737

Last edited: 2014-02-03 15:58

TelType is a rudiment of old TKOpenGl implementation which usage has been almost eliminated - TelText is the only one which is processed in special way in OpenGl_Group::Render() since TelMarker/TelMarkerSet no more exist.

So I consider removal of this ambiguous enumeration and field (fix OpenGl_Text if needed, fix raytracing code).

Pawel

2014-02-03 16:39

developer   ~0027738

Dear kgv,

branch CR24590 pushed.

This is not exactly what you meant but it avoids the crash at least.

kgv

2014-02-03 21:22

developer   ~0027742

Dear apl,

the patch that eliminates TelType enumeration is ready for review in CR24590_1 branch.

apl

2014-02-04 11:22

developer   ~0027744

Dear Bugmaster,

The branch is reviewed.

Please test.

mkv

2014-02-05 11:22

tester   ~0027757

Dear BugMaster,

Branch CR24590_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: f3a702dd7d81700f8aeab6d6358123f585d5b3dd

Number of compiler warnings:

occt component :
Linux: 41 (44 on master)
Windows: 0 (0 on master)

products component :
Linux: 12 (12 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 371629920 / 372433200
Total CPU difference: 41234.97000000014 / 43920.07000000019

Testing on Windows:
Total MEMORY difference: 419555596 / 409848796
Total CPU difference: 33099.90625 / 35405.859375

There are not differences in images found by testdiff.

Related Changesets

occt: master 5322131b

2014-02-06 07:01:00

kgv


Committer: apn Details Diff
0024590: Crash when processing OpenGl_BndBoxPrs objects

Eliminate TelType enumeration
Cosmetics, warnings
Affected Issues
0024590
mod - src/OpenGl/FILES Diff File
mod - src/OpenGl/OpenGl_GraphicDriver.cxx Diff File
mod - src/OpenGl/OpenGl_GraphicDriver_713.cxx Diff File
mod - src/OpenGl/OpenGl_Group.cxx Diff File
mod - src/OpenGl/OpenGl_Group.hxx Diff File
mod - src/OpenGl/OpenGl_SceneGeometry.cxx Diff File
mod - src/OpenGl/OpenGl_Structure.cxx Diff File
mod - src/OpenGl/OpenGl_Text.cxx Diff File
mod - src/OpenGl/OpenGl_Texture.hxx Diff File
rm - src/OpenGl/OpenGl_tsm.hxx Diff File
mod - src/OpenGl/OpenGl_Workspace.hxx Diff File
mod - src/OpenGl/OpenGl_Workspace_Raytrace.cxx Diff File

Issue History

Date Modified Username Field Change
2014-02-03 14:55 Pawel New Issue
2014-02-03 14:55 Pawel Assigned To => Pawel
2014-02-03 15:56 kgv Note Added: 0027737
2014-02-03 15:57 kgv Target Version => 6.7.1
2014-02-03 15:58 kgv Note Edited: 0027737
2014-02-03 16:39 Pawel Note Added: 0027738
2014-02-03 16:39 Pawel Assigned To Pawel => kgv
2014-02-03 16:39 Pawel Status new => resolved
2014-02-03 21:22 kgv Note Added: 0027742
2014-02-03 21:22 kgv Assigned To kgv => apl
2014-02-04 11:22 apl Note Added: 0027744
2014-02-04 11:22 apl Assigned To apl => bugmaster
2014-02-04 11:22 apl Status resolved => reviewed
2014-02-04 12:53 mkv Assigned To bugmaster => mkv
2014-02-05 11:22 mkv Note Added: 0027757
2014-02-05 11:24 mkv Test case number => Not needed
2014-02-05 11:24 mkv Assigned To mkv => bugmaster
2014-02-05 11:24 mkv Status reviewed => tested
2014-02-10 12:41 apn Changeset attached => occt master 5322131b
2014-02-10 12:41 apn Assigned To bugmaster => apn
2014-02-10 12:41 apn Status tested => verified
2014-02-10 12:41 apn Resolution open => fixed
2014-04-04 13:30 abv Target Version 6.7.1 => 6.8.0
2014-11-11 12:47 aiv Fixed in Version => 6.8.0
2014-11-11 12:51 aiv Status verified => closed