MantisBT - Community
View Issue Details
0031132Community[OCCT] OCCT:Visualizationpublic2019-11-05 18:322021-03-02 15:58
Vico Liang 
feedbackunable to reproduce 
[OCCT] 7.4.0 
[OCCT] 7.6.0* 
0031132: Visualization - Deactivate should not trigger Standard_ProgramError
Stack trace as below, Standard_ProgramError exception should not occur.

void AIS_InteractiveContext::Deactivate (const Handle(AIS_InteractiveObject)& theObj)
SelectMgr_ViewerSelector::Deactivate (const Handle(SelectMgr_Selection)& theSelection)
void SelectMgr_ToleranceMap::Decrement (const Standard_Integer& theTolerance)

Standard_ProgramError_Raise_if (*aFreq == 0, "SelectMgr_ToleranceMap::Decrement() - internal error");

Above codes will trigger Standard_ProgramError in some cases. Not always.

The file "deactivate throw.brep" has two wires, use Boolean fuse to unite these two wires to one. and then try to display and deactivate it. The first time should throw.
No tags attached.
related to 0030452closed bugmaster Open CASCADE Visualization - SelectMgr_ViewerSelector::Deactivate() raises exception when called twice 
Issue History
2019-11-05 18:32Vico LiangNew Issue
2019-11-05 18:32Vico LiangAssigned To => kgv
2019-11-05 18:35kgvNote Added: 0088737
2019-11-05 18:53kgvRelationship addedrelated to 0030452
2019-11-05 18:54kgvNote Added: 0088738
2019-11-05 19:39Vico LiangProduct Version => 7.4.0
2019-11-05 19:51Vico LiangFile Added: deactivate throw.brep
2019-11-05 19:51Vico LiangFile Added: deactivate throw.jpg
2019-11-05 19:54Vico LiangDescription Updatedbug_revision_view_page.php?rev_id=22155#r22155
2019-11-05 19:56Vico LiangNote Added: 0088739
2019-11-06 14:36kgvNote Added: 0088751
2019-11-09 05:30Vico LiangNote Added: 0088821
2019-11-11 11:20kgvNote Added: 0088887
2019-11-11 11:21kgvAssigned Tokgv => Vico Liang
2019-11-11 11:21kgvStatusnew => feedback
2019-11-11 11:21kgvResolutionopen => unable to reproduce
2020-03-14 07:58Vico LiangNote Added: 0090933
2020-03-14 07:59Vico LiangAssigned ToVico Liang => kgv
2020-03-14 07:59Vico LiangStatusfeedback => assigned
2020-03-14 08:37Vico LiangFile Deleted: deactivate throw.jpg
2020-03-14 08:37Vico LiangFile Deleted: deactivate throw.brep
2020-03-17 18:05kgvNote Added: 0090990
2020-03-17 18:05kgvAssigned Tokgv => Vico Liang
2020-03-17 18:05kgvStatusassigned => feedback
2020-03-18 12:18Vico LiangNote Added: 0091014
2020-03-18 12:19Vico LiangAssigned ToVico Liang => kgv
2020-09-21 17:42kgvTarget Version7.5.0 => 7.6.0*
2021-03-02 15:58kgvSummaryVisualization - Deactivate should not trigger Standard_ProgramError. => Visualization - Deactivate should not trigger Standard_ProgramError

2019-11-05 18:35   
This is an assertion for invalid situation.
Reproducer is needed for analysis.
2019-11-05 18:54   
Please also specify OCCT version.
Vico Liang   
2019-11-05 19:56   
Uploaded files and picture to help reproduce the issue. The version is testing on OCCT7.4.0 after enable exception build.
2019-11-06 14:36   
Steps to reproduce are incomplete - nothing happens with provided scenario.
restore {deactivate throw.brep} b
explode b
bfuse r b_1 b_2
vinit View1
vdisplay r
vselmode r 0 0
Vico Liang   
2019-11-09 05:30   
Dear kgv,
I found that this problem just occurs when there is dirty selection in context. The AIS_Object's shape is updated, but its selection is still in AIS_Context. We need to remove the old selection from AIS_Context before calling Deactivate. This might not be a bug of OCCT. it's a program issue should be avoided from coding. You can close this.
2019-11-11 11:20   
Good to hear, that you have found the problem at application side.

But we can keep the bug open, if you can prepare a reproducer and there are some doubts that this can be an OCCT bug.
Vico Liang   
2020-03-14 07:58   
This issue happens, the stacktrace as below:

  #06 pc 0000000001473854 (SelectMgr_ToleranceMap::Decrement(int const&)+312)
  0000007 pc 00000000013c1054 (SelectMgr_ViewerSelector::Deactivate(opencascade::handle<SelectMgr_Selection> const&)+208)
  0000008 pc 00000000014711a8 (SelectMgr_SelectionManager::Remove(opencascade::handle<SelectMgr_SelectableObject> const&)+328)
  0000009 pc 00000000013fc294 (AIS_InteractiveContext::ClearGlobal(opencascade::handle<AIS_InteractiveObject> const&, bool)+644)
  #10 pc 00000000013fbf68 (AIS_InteractiveContext::Remove(opencascade::handle<AIS_InteractiveObject> const&, bool)+136)
  0000011 pc 0000000000abc0f0 (AIS_InteractiveContext::Remove2(opencascade::handle<AIS_InteractiveObject> const&)+20)
  #12 pc 0000000000af2550 (TPrsStd_AISPresentation::AISErase(bool)+76)
  0000013 pc 0000000000af27d0 (TPrsStd_AISPresentation::BeforeUndo(opencascade::handle<TDF_AttributeDelta> const&, bool)+200)
2020-03-17 18:05   
Do you have a reproducible code / script for the stack trace?
Vico Liang   
2020-03-18 12:18   
the stack trace is from google app store console, I don't have code to reproduce the issue. i even can't reproduce it on my owne side. It occured rather freqently on user phone. I guess there may some issue on occt side.