View Issue Details

IDProjectCategoryView StatusLast Update
0028946Open CASCADEOCCT:Application Frameworkpublic2018-04-03 12:27
ReporterdbvAssigned Tobugmaster  
PrioritynormalSeveritymajor 
Status closedResolutionfixed 
Target Version7.2.0Fixed in Version7.2.0 
Summary0028946: Exception on Undo
DescriptionException (Standard_DomainError: This label has already such an attribute) raised when trying to Undo changes done by XCAFDoc_DimTolTool::SetDimension (const TDF_Label &theL, const TDF_Label &theDimTolL)

It seems that one of the delta is lost or they applying in the wrong order.
Steps To Reproducestatic Standard_Integer TestUndo (Draw_Interpretor& theDI,
                                  Standard_Integer theArgC,
                                  const char** theArgV)
{
  Handle (TDocStd_Application) anApp = DDocStd::GetApplication ();
  Handle (TDocStd_Document) aDoc;
  anApp->NewDocument ("BinOcaf", aDoc);
  aDoc->SetUndoLimit (1);

  STEPCAFControl_Reader Reader;
  Reader.ReadFile ("D:/nist_ctc_02_asme1_ap242-2.stp");
  Reader.Transfer (aDoc);
  TDF_Label aShL, aDL;
  TDF_Tool::Label (aDoc->GetData(), "0:1:1:2:672", aShL);
  TDF_Tool::Label (aDoc->GetData (), "0:1:4:10", aDL);

  aDoc->OpenCommand ();

  Handle (XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool (aDoc->Main ());
  aDimTolTool->SetDimension (aShL, aDL);

  aDoc->CommitCommand ();

  aDoc->Undo ();

  return 0;
}

Added testing script caf/bugs/E1
TagsNo tags attached.
Test case numbercaf bugs E1

Attached Files

  • nist_ctc_02_asme1_ap242-2.stp (3,611,524 bytes)

Relationships

related to 0028908 closedbugmaster Open CASCADE Improvement on attachment of attributes to the label 
related to 0028973 closedbugmaster Open CASCADE Undo/Redo changes the order of some attributes 
related to 0029116 closedbugmaster Community [Regression] OCAF attributes insertion order is violated again 
related to 0029142 closedbugmaster Open CASCADE Exception on Redo 
related to 0029531 closedbugmaster Open CASCADE Application Framework - Exception on Redo 
child of 0024755 closedmpv Community TDF_Label::AddAttribute() reverses the order of added attributes 

Activities

dbv

2017-07-25 11:05

developer  

nist_ctc_02_asme1_ap242-2.stp (3,611,524 bytes)

dbv

2017-07-25 12:11

developer   ~0068663

Simpler test case:
static Standard_Integer TestUndo (Draw_Interpretor& theDI,
                                  Standard_Integer theArgC,
                                  const char** theArgV)
{
  Handle (TDocStd_Application) anApp = DDocStd::GetApplication ();
  Handle (TDocStd_Document) aDoc;
  anApp->NewDocument ("BinOcaf", aDoc);

  TDataStd_Integer::Set (aDoc->Main (), 1);
  TDataStd_Real::Set (aDoc->Main (), 1);

  aDoc->SetUndoLimit (1);
  aDoc->OpenCommand ();

  aDoc->Main ().ForgetAttribute (TDataStd_Integer::GetID ());
  TDataStd_Integer::Set (aDoc->Main (), 1);

  aDoc->CommitCommand ();

  aDoc->Undo ();

  return 0;
}

mpv

2017-07-25 13:34

developer   ~0068669

It seems it will be fixed with 0028908 issue fix.

dbv

2017-07-25 14:12

developer   ~0068673

In my opinion patch for the issue 0028908 will not fix described problem. As I understood from the description it only adds possibility to choose where to add the attribute. To the top of the list or to the end. So this patch will only fix default scenarios, when new attribute prepends to the list. But as there is a possibility to add attribute to the end of the list the problem can be easily reproduced.

vro

2017-08-01 10:10

developer   ~0069006

Without the fix of CR28908 the draw-command TestUndo crashes, having applied the patch it prints:

Draw[2]> testundo
Report : 43 unknown entities.

I think it is much better than a crash :-). What do you think?

mpv

2017-08-01 10:26

developer   ~0069008

So, this bug is fixed by the fix in 28908.

Anyway, it is worth to prepare a unit-test based on simplified scenario provided by dbv in order to avoid such problem in the future.

git

2017-08-01 18:32

administrator   ~0069038

Branch CR28946 has been created by szy.

SHA-1: e23218080b7c3a9c0c1d1bc28bde7317cd499a3a


Detailed log of new commits:

Author: szy
Date: Tue Aug 1 18:31:33 2017 +0300

    0028946: Exception on Undo.
    
    //Added additional command ForgetAtt and test case E1 to test issue 28946.

szy

2017-08-01 18:34

manager   ~0069039

Review it, please.

git

2017-08-02 18:15

administrator   ~0069064

Branch CR28946 has been updated forcibly by inv.

SHA-1: e16302cee1fb8fe3bd5ec293fb1a4d5f0d871955

bugmaster

2017-08-02 18:15

administrator   ~0069065

CR28946 has been rebased on current master.

Testing CR28946 has been started on jenkins-test-10.

szy

2017-08-03 09:57

manager   ~0069079

Result of testing on jenkins-test-10:
http://jenkins-test-10.nnov.opencascade.com:8080/view/CR28946-master/view/ALL/

bugmaster

2017-08-03 17:12

administrator   ~0069091

Combination -
OCCT branch : CR28946 ; SHA1 : e16302cee1fb8fe3bd5ec293fb1a4d5f0d871955
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:

OCCT :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Products :
Linux: 5 (5 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
No differences that required special attention

Image differences :
No differences that required special attention

Memory differences :
No differences that required special attention

Testing cases are OK:
http://occt-tests/CR28946-master-OCCT/Debian70-64/caf/bugs/E1.html
http://occt-tests/CR28946-master-OCCT/Windows-64-VC10/caf/bugs/E1.html



git

2017-08-18 17:00

administrator   ~0069641

Branch CR28946 has been deleted by kgv.

SHA-1: e16302cee1fb8fe3bd5ec293fb1a4d5f0d871955

Related Changesets

occt: master e16302ce

2017-08-01 15:31:33

szy


Committer: bugmaster Details Diff
0028946: Exception on Undo.

//Added additional command ForgetAtt and test case E1 to test issue 28946.
Affected Issues
0028946
mod - src/DDF/DDF_BasicCommands.cxx Diff File
add - tests/caf/bugs/E1 Diff File

Issue History

Date Modified Username Field Change
2017-07-25 11:05 dbv New Issue
2017-07-25 11:05 dbv Assigned To => mpv
2017-07-25 11:05 dbv File Added: nist_ctc_02_asme1_ap242-2.stp
2017-07-25 11:06 ssv Severity minor => major
2017-07-25 12:11 dbv Note Added: 0068663
2017-07-25 13:33 mpv Assigned To mpv => vro
2017-07-25 13:33 mpv Relationship added related to 0028908
2017-07-25 13:34 mpv Note Added: 0068669
2017-07-25 14:12 dbv Note Added: 0068673
2017-08-01 10:10 vro Note Added: 0069006
2017-08-01 10:26 mpv Note Added: 0069008
2017-08-01 11:00 vro Assigned To vro => szy
2017-08-01 11:17 szy Status new => assigned
2017-08-01 18:32 git Note Added: 0069038
2017-08-01 18:34 szy Note Added: 0069039
2017-08-01 18:34 szy Assigned To szy => vro
2017-08-01 18:34 szy Status assigned => resolved
2017-08-01 18:34 szy Steps to Reproduce Updated
2017-08-02 07:10 vro Assigned To vro => bugmaster
2017-08-02 07:10 vro Status resolved => reviewed
2017-08-02 18:15 git Note Added: 0069064
2017-08-02 18:15 bugmaster Note Added: 0069065
2017-08-02 19:51 bugmaster Test case number => caf bugs E1
2017-08-03 09:57 szy Note Added: 0069079
2017-08-03 17:12 bugmaster Note Added: 0069091
2017-08-03 17:12 bugmaster Status reviewed => tested
2017-08-07 08:43 vro Relationship added related to 0028973
2017-08-11 07:52 bugmaster Changeset attached => occt master e16302ce
2017-08-11 07:52 bugmaster Status tested => verified
2017-08-11 07:52 bugmaster Resolution open => fixed
2017-08-18 17:00 git Note Added: 0069641
2017-09-15 14:53 mpv Relationship added related to 0029116
2017-09-15 15:26 abv Relationship added child of 0024755
2017-09-25 17:41 dbv Relationship added related to 0029142
2017-09-29 16:17 aiv Fixed in Version => 7.2.0
2017-09-29 16:24 aiv Status verified => closed
2018-03-01 15:03 dbv Relationship added related to 0029531