Archived issue #0024047
Exception in TPrsStd_AISPresentation during destruction of TDocStd_Document
Description
During destruction of TDocStd_Document exception is raised in method TPrsStd_AISPresentation::AISErase() because TPrsStd_AISPresentation contains pointer on already destructed AIS_InteractiveContext.
Steps to reproduce
Draw command to reproduce this situation is added. Now it is possible to reproduce this situation in TestHarness by command:
box a 0 0 0 10 10 10
XTestDoc a
Or it is possible to make following sequence of actions:
Handle(XCAFApp_Application) A = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aD1 = new TDocStd_Document("MDTV-XCAF");
aD1->Open(A);
Handle(V3d_Viewer) vw = ViewerTest_Tool::MakeViewer ("Test viwer");
Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(vw);
TPrsStd_AISViewer::New (aD1->Main(),aContext);
Handle(XCAFDoc_ShapeTool) aShapes =
XCAFDoc_DocumentTool::ShapeTool (aD1->Main());
TDF_Label aLab = aShapes->AddShape(shape);
Handle(TNaming_NamedShape) NS;
Handle(TPrsStd_AISPresentation) prs;
if( aLab.FindAttribute( TNaming_NamedShape::GetID(), NS) ) {
prs = TPrsStd_AISPresentation::Set( NS );
}
if( aLab.FindAttribute(TPrsStd_AISPresentation::GetID(), prs) )
prs->Display();
TPrsStd_AISViewer::Update(aLab);
Handle(TDocStd_Owner) owner;
if (aD1->Main().Root().FindAttribute(TDocStd_Owner::GetID(), owner))
{
Handle_TDocStd_Document empty;
owner->SetDocument(empty);
}
aContext.Nullify();
aD1->Close();
aD1.Nullify();
box a 0 0 0 10 10 10
XTestDoc a
Or it is possible to make following sequence of actions:
Handle(XCAFApp_Application) A = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aD1 = new TDocStd_Document("MDTV-XCAF");
aD1->Open(A);
Handle(V3d_Viewer) vw = ViewerTest_Tool::MakeViewer ("Test viwer");
Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(vw);
TPrsStd_AISViewer::New (aD1->Main(),aContext);
Handle(XCAFDoc_ShapeTool) aShapes =
XCAFDoc_DocumentTool::ShapeTool (aD1->Main());
TDF_Label aLab = aShapes->AddShape(shape);
Handle(TNaming_NamedShape) NS;
Handle(TPrsStd_AISPresentation) prs;
if( aLab.FindAttribute( TNaming_NamedShape::GetID(), NS) ) {
prs = TPrsStd_AISPresentation::Set( NS );
}
if( aLab.FindAttribute(TPrsStd_AISPresentation::GetID(), prs) )
prs->Display();
TPrsStd_AISViewer::Update(aLab);
Handle(TDocStd_Owner) owner;
if (aD1->Main().Root().FindAttribute(TDocStd_Owner::GetID(), owner))
{
Handle_TDocStd_Document empty;
owner->SetDocument(empty);
}
aContext.Nullify();
aD1->Close();
aD1.Nullify();
Public activity
12 archived notes
Participants are labeled by their role within this record.
Branch CR24047 is ready to be reviewed.
Branch CR24047 reviewed without remarks, ready for testing.
Dear Commenter 2,
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
(Only on Linux)
http://occt-tests/CR24047-master-occt/Debian60-64/summary.html
3rdparty export(001) A2, A3, A4, A5, A6, A7
3rdparty fonts(002) A2, A3, A4, A5, A6
bugs vis(004) buc60814, bug128, bug21091_2, bug21091_4, bug21091_6, bug21091_7, bug21091_8, bug21091_9, bug23747_1
perf multi_mesh_selection(001) A1, A2, A3, A4, A5, A6
perf multi_mesh_shading(002) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_mesh_shrink(003) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_mesh_wireframe(004) A1, A2, A3, A4,A5, A6, A7, A8
perf multi_object_hlr(005) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_object_selection(006) A1, A2, A3, B1, B2, B3, B4, B5, B6, D1, D2, D3
perf multi_object_shading(007) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_object_wireframe(008) A1, A2, A3, A4, A5, A6, A7, A8, A1, A3, A4, A5, A6
perf single_mesh_shading(010) A1, A2, A3, A4, A5, A6
perf single_mesh_shrink(011) A1, A2, A3, A4, A5, A6, A7
perf single_mesh_wireframe(012) A1, A2, A3, A5, A7, A8
perf single_object_hlr(013) A3, A4, A5, A7
perf single_object_selection(014) A1, A2, B2, D1, D3
perf single_object_shading(015) A2, A3, A5
perf single_object_wireframe(016) A1, A3, A4, A5
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - BAD; it is necessary to correct return value of XTestDoc draw-commnad
Testing on Linux:
Total MEMORY difference: 362699244 / 362790964
Total CPU difference: 44049.06000000094 / 48002.090000000884
Testing on Windows:
Total MEMORY difference: 422179236 / 423696892
Total CPU difference: 42311.28125 / 37862.03125
There are not differences in images found by testdiff.
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
(Only on Linux)
http://occt-tests/CR24047-master-occt/Debian60-64/summary.html
3rdparty export(001) A2, A3, A4, A5, A6, A7
3rdparty fonts(002) A2, A3, A4, A5, A6
bugs vis(004) buc60814, bug128, bug21091_2, bug21091_4, bug21091_6, bug21091_7, bug21091_8, bug21091_9, bug23747_1
perf multi_mesh_selection(001) A1, A2, A3, A4, A5, A6
perf multi_mesh_shading(002) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_mesh_shrink(003) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_mesh_wireframe(004) A1, A2, A3, A4,A5, A6, A7, A8
perf multi_object_hlr(005) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_object_selection(006) A1, A2, A3, B1, B2, B3, B4, B5, B6, D1, D2, D3
perf multi_object_shading(007) A1, A2, A3, A4, A5, A6, A7, A8
perf multi_object_wireframe(008) A1, A2, A3, A4, A5, A6, A7, A8, A1, A3, A4, A5, A6
perf single_mesh_shading(010) A1, A2, A3, A4, A5, A6
perf single_mesh_shrink(011) A1, A2, A3, A4, A5, A6, A7
perf single_mesh_wireframe(012) A1, A2, A3, A5, A7, A8
perf single_object_hlr(013) A3, A4, A5, A7
perf single_object_selection(014) A1, A2, B2, D1, D3
perf single_object_shading(015) A2, A3, A5
perf single_object_wireframe(016) A1, A3, A4, A5
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - BAD; it is necessary to correct return value of XTestDoc draw-commnad
Testing on Linux:
Total MEMORY difference: 362699244 / 362790964
Total CPU difference: 44049.06000000094 / 48002.090000000884
Testing on Windows:
Total MEMORY difference: 422179236 / 423696892
Total CPU difference: 42311.28125 / 37862.03125
There are not differences in images found by testdiff.
Branch 24047 was updated. Method of AIS_Trihedron::SetContext() is modified.
Branch 24047 is ready to be reviewed.
Branch 24047 is ready to be reviewed.
Branch CR24047 reviewed without remarks, ready for testing.
Dear Commenter 2,
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
http://occt-tests/CR24047-master-occt/Debian60-64/summary.html
3rdparty export(001) A2, A3, A4, A6, A7
bugs vis(004) buc60814, bug61, bug22368
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - BAD; it is necessary to correct return value of XTestDoc draw-commnad
Testing on Linux:
Total MEMORY difference: 366027224 / 366074120
Total CPU difference: 42683.43000000068 / 43399.41000000103
Testing on Windows:
Total MEMORY difference: 408308652 / 412106936
Total CPU difference: 40789.3125 / 43448.234375
There are following differences in images found by testdiff.
http://occt-tests/CR24047-master-occt/Debian60-64/diff-Debian60-64.html
IMAGE bugs vis buc60818: buc60818_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug223: bug22332_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug22332: bug22332_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug5988: bug5988_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug23652: bug23652_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug21091_2: bug21091_2_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug21091_4: bug21091_4_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug21091_5: bug21091_5_Driver1_Viewer1_View1.png differs
....
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
http://occt-tests/CR24047-master-occt/Debian60-64/summary.html
3rdparty export(001) A2, A3, A4, A6, A7
bugs vis(004) buc60814, bug61, bug22368
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - BAD; it is necessary to correct return value of XTestDoc draw-commnad
Testing on Linux:
Total MEMORY difference: 366027224 / 366074120
Total CPU difference: 42683.43000000068 / 43399.41000000103
Testing on Windows:
Total MEMORY difference: 408308652 / 412106936
Total CPU difference: 40789.3125 / 43448.234375
There are following differences in images found by testdiff.
http://occt-tests/CR24047-master-occt/Debian60-64/diff-Debian60-64.html
IMAGE bugs vis buc60818: buc60818_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug223: bug22332_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug22332: bug22332_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug5988: bug5988_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug23652: bug23652_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug21091_2: bug21091_2_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug21091_4: bug21091_4_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug21091_5: bug21091_5_Driver1_Viewer1_View1.png differs
....
Branch CR24047 is ready to be reviewed
Branch CR24047 reviewed without remarks, ready for testing.
Dear gka,
the following changes look redundant since both NULL check and nullifying are performed inside method OpenGl_Element::Destroy() by design.
- OpenGl_Element::Destroy (theCtx, myTrihedron);
- OpenGl_Element::Destroy (theCtx, myGraduatedTrihedron);
+ if( myTrihedron != NULL)
+ {
+ OpenGl_Element::Destroy (theCtx, myTrihedron);
+ myTrihedron =NULL;
+ }
the following changes look redundant since both NULL check and nullifying are performed inside method OpenGl_Element::Destroy() by design.
- OpenGl_Element::Destroy (theCtx, myTrihedron);
- OpenGl_Element::Destroy (theCtx, myGraduatedTrihedron);
+ if( myTrihedron != NULL)
+ {
+ OpenGl_Element::Destroy (theCtx, myTrihedron);
+ myTrihedron =NULL;
+ }
Dear Commenter 2,
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 8 (8 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - OK
Testing on Linux:
Total MEMORY difference: 365488972 / 365745120
Total CPU difference: 48747.20000000101 / 45334.67000000106
Testing on Windows:
Total MEMORY difference: 424293672 / 426125448
Total CPU difference: 34421.28125 / 35067.859375
There are not differences in images found by testdiff.
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 8 (8 on master)
products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - OK
Testing on Linux:
Total MEMORY difference: 365488972 / 365745120
Total CPU difference: 48747.20000000101 / 45334.67000000106
Testing on Windows:
Total MEMORY difference: 424293672 / 426125448
Total CPU difference: 34421.28125 / 35067.859375
There are not differences in images found by testdiff.
Branch [archived branch] has been updated (the last remark taken into account), could you please re-test it?
Dear Commenter 2,
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 1768 (1767 on master)
products component :
Linux: 0 (0 on master)
Windows: 288 (288 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - OK
Testing on Linux:
Total MEMORY difference: 355156632 / 437029128
Total CPU difference: 35781.970000000656 / 130364.23999999979
Testing on Windows:
Total MEMORY difference: 424385864 / 426119972
Total CPU difference: 35690.859375 / 31424.28125
There are not differences in images found by testdiff.
Branch CR24047 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 1768 (1767 on master)
products component :
Linux: 0 (0 on master)
Windows: 288 (288 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
bugs caf(015) bug24047 - OK
Testing on Linux:
Total MEMORY difference: 355156632 / 437029128
Total CPU difference: 35781.970000000656 / 130364.23999999979
Testing on Windows:
Total MEMORY difference: 424385864 / 426119972
Total CPU difference: 35690.859375 / 31424.28125
There are not differences in images found by testdiff.
Related records