View Issue Details

IDProjectCategoryView StatusLast Update
0024196CommunityOCCT:Visualizationpublic2013-11-06 16:08
ReporterPawel Assigned ToPawel  
PrioritynormalSeveritycrash 
Status closedResolutionunable to reproduce 
PlatformWindowsOSVC++ 2008 
Product Version6.6.0 
Target Version6.7.0 
Summary0024196: Appplication crash when displaying AIS_Trihedron
DescriptionA crash occurs when trying to display the AIS_Trihedron in the constructor of the document of a MFC application.

The problem occurred after integration of 0024131.

No crash occurs if the AIS_Trihedron is displayed after the application initialization.
Steps To ReproduceReproducer: Viewer3d MFC sample application.

Uncomment the following code portion in Viewer3dDoc.cpp / CViewer3dDoc::CViewer3dDoc()

===================
Handle(AIS_Trihedron) myTrihedron;
Handle(Geom_Axis2Placement) myTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
myTrihedron=new AIS_Trihedron(myTrihedronAxis);
myAISContext->Display(myTrihedron);
=============

A crash occurs in OpenGl_Context::GetResource (OpenGl_Context.cxx, line 1054).
TagsNo tags attached.
Test case number

Attached Files

Activities

Pawel

2013-10-22 18:21

developer   ~0026216

Here is the stack trace (master from 17.10.2013 on VS2012 64bit):

     TKOpenGl.dll!Handle_Standard_Transient::ControlAccess() Line 215 C++
     TKOpenGl.dll!NCollection_Handle<NCollection_DataMap<TCollection_AsciiString,Handle_OpenGl_Resource,NCollection_DefaultHasher<TCollection_AsciiString> > >::operator->() Line 96 C++
     TKOpenGl.dll!OpenGl_Context::GetResource(const TCollection_AsciiString & theKey) Line 1095 C++
     TKOpenGl.dll!OpenGl_Context::GetResource<Handle_OpenGl_PointSprite>(const TCollection_AsciiString & theKey, Handle_OpenGl_PointSprite & theValue) Line 208 C++
     TKOpenGl.dll!OpenGl_AspectMarker::Init(const Handle_OpenGl_Context & theCtx, const CALL_DEF_CONTEXTMARKER & theAspect) Line 1546 C++
     TKOpenGl.dll!OpenGl_Structure::SetAspectMarker(const Handle_OpenGl_Context & theCtx, const CALL_DEF_CONTEXTMARKER & theAspect) Line 223 C++
     TKOpenGl.dll!OpenGl_GraphicDriver::ContextStructure(const Graphic3d_CStructure & theCStructure) Line 53 C++
     TKV3d.dll!Graphic3d_Structure::SetPrimitivesAspect(const Handle_Graphic3d_AspectFillArea3d & CTX) Line 1233 C++
     TKV3d.dll!Prs3d_Presentation::Prs3d_Presentation(const Handle_Graphic3d_StructureManager & aViewer, const unsigned int Init) Line 84 C++
     TKV3d.dll!PrsMgr_Prs::PrsMgr_Prs(const Handle_Graphic3d_StructureManager & aStructureManager, PrsMgr_Presentation3d * const & aPresentation3d, const PrsMgr_TypeOfPresentation3d aTypeOfPresentation) Line 29 C++
     TKV3d.dll!PrsMgr_Presentation3d::PrsMgr_Presentation3d(const Handle_PrsMgr_PresentationManager3d & aPresentationManager, const Handle_PrsMgr_PresentableObject & aPresentableObject) Line 43 C++
     TKV3d.dll!PrsMgr_PresentationManager3d::newPresentation(const Handle_PrsMgr_PresentableObject & aPresentableObject) Line 34 C++
     TKV3d.dll!PrsMgr_PresentationManager::AddPresentation(const Handle_PrsMgr_PresentableObject & aPresentableObject, const int aMode) Line 228 C++
     TKV3d.dll!PrsMgr_PresentationManager::Display(const Handle_PrsMgr_PresentableObject & aPresentableObject, const int aMode) Line 36 C++
     TKV3d.dll!AIS_InteractiveContext::Display(const Handle_AIS_InteractiveObject & anIObj, const unsigned int updateviewer) Line 404 C++
     TKCAF.dll!TPrsStd_AISPresentation::AISDisplay() Line 1018 C++
> TKCAF.dll!TPrsStd_AISPresentation::Display(const unsigned int update) Line 153 C++

san

2013-11-01 19:29

developer   ~0026425

Dear bugmaster,

Can you please try to reproduce it with the current master?

bugmaster

2013-11-05 10:13

administrator   ~0026446

Dear MKV,

Can you please try to reproduce it with the current master?

apl

2013-11-05 12:17

developer  

trihedron.png (55,146 bytes)   

apl

2013-11-05 13:00

developer   ~0026451

Dear Bugmaster,

The Viewer3d MFC sample has been tested on current master (IR-2013-11-01) VC9 win32 in "debug" and "release" configurations.

The crash is not reproduced.

In current implementation of the sample, the displayed trihedron is erased after opening the new document:

BOOL CViewer3dDoc::OnNewDocument()
{
  if (!CDocument::OnNewDocument())
    return FALSE;

  // TODO: add reinitialization code here
  // (SDI documents will reuse this document)
  SetTitle(myPresentation->GetName());

  myAISContext->EraseAll(); <-- comment this
  myAISContext->SetDisplayMode(AIS_Shaded);

  POSITION pos = GetFirstViewPosition();
  while (pos != NULL)
  {
    CViewer3dView* pView = (CViewer3dView*) GetNextView(pos);
    pView->Reset();
  }

  return TRUE;
}

In order to avoid this and see the trihedron (keeping the code of displaying the trihedron "as is") the marked line should be commented.

Pawel

2013-11-05 13:08

developer   ~0026452

I tested on IR-2013-10-24 and the problem is not reproduced anymore.

Issue History

Date Modified Username Field Change
2013-09-20 17:25 Pawel New Issue
2013-09-20 17:25 Pawel Assigned To => san
2013-09-20 17:36 Pawel Steps to Reproduce Updated
2013-09-20 17:37 Pawel Steps to Reproduce Updated
2013-10-22 18:21 Pawel Note Added: 0026216
2013-11-01 19:29 san Note Added: 0026425
2013-11-01 19:29 san Assigned To san => bugmaster
2013-11-01 19:29 san Status new => feedback
2013-11-05 10:13 bugmaster Assigned To bugmaster => mkv
2013-11-05 10:13 bugmaster Note Added: 0026446
2013-11-05 11:56 mkv Assigned To mkv => apl
2013-11-05 12:17 apl File Added: trihedron.png
2013-11-05 13:00 apl Note Added: 0026451
2013-11-05 13:00 apl Assigned To apl => bugmaster
2013-11-05 13:00 apl Status feedback => resolved
2013-11-05 13:01 apl Status resolved => feedback
2013-11-05 13:08 Pawel Note Added: 0026452
2013-11-06 16:08 bugmaster Status feedback => closed
2013-11-06 16:08 bugmaster Assigned To bugmaster => Pawel
2013-11-06 16:08 bugmaster Resolution open => unable to reproduce