View Issue Details

IDProjectCategoryView StatusLast Update
0029142Open CASCADEOCCT:Application Frameworkpublic2018-06-29 21:19
ReporterdbvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.3.0Fixed in Version7.3.0 
Summary0029142: Exception on Redo
DescriptionProblem described in issue 0028946 is not actually fixed. Now it reproduces on Redo. This is due to the fact that deltas are applied in the order of attributes on the label, and not in the order of their real change.
Steps To Reproducestatic Standard_Integer TestRedo (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 ();
  aDoc->Redo ();

  return 0;
}


Test => ..\tests\bugs\caf\bug29142
TagsNo tags attached.
Test case numberbugs caf bug29142

Relationships

related to 0028946 closedbugmaster Open CASCADE Exception on Undo 
related to 0029116 closedbugmaster Community [Regression] OCAF attributes insertion order is violated again 
related to 0029531 closedbugmaster Open CASCADE Application Framework - Exception on Redo 
related to 0029884 closedbugmaster Community Application Framework - Calling sequence of BeforeUndo() and AfterUndo() unpredictable 

Activities

mpv

2017-10-03 14:41

developer   ~0071153

So, here the any order of attributes could not help. It is proposed to process removed attributes (which will be created) after all other deltas processing.

git

2017-10-12 15:53

administrator   ~0071372

Branch CR29142 has been created by szy.

SHA-1: 6b2c520f808bd38ec5b37291b91aa1ec03952b79


Detailed log of new commits:

Author: szy
Date: Thu Oct 12 15:53:27 2017 +0300

    0029142: Exception on Redo.
    
    //Forgotten attribute status is taken into account.

Author: szy
Date: Thu Oct 12 15:43:08 2017 +0300

    Merge branch 'master' of git.dev.opencascade.org:occt

Author: szy
Date: Tue Oct 3 16:23:37 2017 +0300

    Merge branch 'master' of git.dev.opencascade.org:occt

Author: szy
Date: Thu Sep 28 18:19:56 2017 +0300

    Merge branch 'master' of git.dev.opencascade.org:occt

szy

2017-10-12 16:07

manager   ~0071375

The issue is fixed by taken into account 'forgotten' status of the attribute.
Review it, please. After I will check it with Jenkins.

git

2017-10-12 17:06

administrator   ~0071379

Branch CR29142 has been updated by szy.

SHA-1: 22c7d0a5f3252f7f183ffba592e70f4e961ba358


Detailed log of new commits:

Author: szy
Date: Thu Oct 12 17:06:40 2017 +0300

    0029142: Exception on Redo.
    
    //test case bugs/caf/bug29142.

mpv

2017-10-16 09:23

developer   ~0071509

With this fix the following code throws no exception.

pload ALL
NewDocument D BinOcaf
UndoLimit D 100
set Lab1 [Label D 0:1:1]
NewCommand D
SetInteger D $Lab1 111
NewCommand D
ForgetAll D $Lab1
CommitCommand D
SetInteger D $Lab1 222
Undo D

However the "master" version does not allow having two attributes on one label.

git

2017-11-15 17:39

administrator   ~0072259

Branch CR29142_1 has been created by szy.

SHA-1: e0faeec217ab9454f5273bbc4d9d65197cd75314


Detailed log of new commits:

Author: szy
Date: Wed Nov 15 17:38:48 2017 +0300

    0029142: Exception on Redo.
    
    //Order of attributes deltas is fixed.

Author: szy
Date: Tue Nov 14 16:54:26 2017 +0300

    Merge branch 'master' of git.dev.opencascade.org:occt

Author: szy
Date: Fri Oct 13 14:23:55 2017 +0300

    Merge branch 'master' of git.dev.opencascade.org:occt

szy

2017-11-15 17:44

manager   ~0072261

The previous solution is changed to reordering of AttributesDeltas inside Delta.
Review it, please.
In addition to this I can propose an alternative solution too.

vro

2017-11-17 09:31

developer   ~0072307

The fix fixes the problem!
Also, your idea to introduce a flag forbidding developers to delete and create the same attribute within one transaction seems reasonable too.
In addition, seems useful to introduce a flag in TDF_Attribute, which allows the attribute to participate in transaction mechanism or not. By default, all attributes participate in undo/redo (no change for default behavior). But some special user-defined attributes might ignore the transactions... this flag might be very useful for such attributes, what do you think?

mpv

2017-11-17 09:39

developer   ~0072309

About the flag to forbid delete and add attribute in one transaction: in complicated applications this may block development because different independent (and external, like XCAF) components may work one the same labels consequently in one transaction. Involving this flag only because of complexity of implementation in OCAF will casue searching workarounds for this limitation.

Participation in transactions flag - I agree, this may be a good idea. Especially if this flag may be defined outside of the attribute (without needs of redefinition of attribute).

szy

2017-11-17 10:18

manager   ~0072311

I prefer to present the idea face to face to avoid useless writing.
Let's meet next week and discuss the idea.

szy

2017-11-20 16:25

manager   ~0072337

Tested - http://jenkins-test-10.nnov.opencascade.com/view/CR29142-master/.

git

2017-11-20 17:20

administrator   ~0072340

Branch CR29142_1 has been updated by szy.

SHA-1: 13dab595d386e5a3ceadbf574d1f9454c6c6429c


Detailed log of new commits:

Author: szy
Date: Mon Nov 20 17:20:32 2017 +0300

    0029142: Exception on Redo.
    
    //Removing extra qualifier

Author: szy
Date: Mon Nov 20 17:07:12 2017 +0300

    Merge branch 'CR29142_1' of git.dev.opencascade.org:occt into CR29142_1

Author: szy
Date: Wed Nov 15 17:38:48 2017 +0300

    0029142: Exception on Redo.
    
    //Order of attributes deltas is fixed.

Author: szy
Date: Mon Nov 20 16:29:04 2017 +0300

    Merge branch 'master' of git.dev.opencascade.org:occt

git

2017-11-20 17:31

administrator   ~0072341

Branch CR29142_2 has been created by szy.

SHA-1: 459f0a36d6739a44b50b3bdf800f5668443d84dd


Detailed log of new commits:

Author: szy
Date: Mon Nov 20 17:31:15 2017 +0300

    0029142: Exception on Redo.
    
    ////Order of attributes deltas is fixed.

szy

2017-11-21 10:08

manager   ~0072355

Tested CR29142_2: => http://jenkins-test-10.nnov.opencascade.com/view/CR29142-master/.

bugmaster

2017-11-21 11:57

administrator   ~0072358

Last edited: 2017-11-21 11:58

Combination -
OCCT branch : CR29142_2 SHA-1: 459f0a36d6739a44b50b3bdf800f5668443d84dd
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Linux:
OCCT
Total CPU difference: 20586.690000000417 / 20649.13000000041 [-0.30%]
Products
Total CPU difference: 7907.560000000076 / 7869.380000000079 [+0.49%]
Windows:
OCCT
Total CPU difference: 18327.231481498555 / 18333.206319798577 [-0.03%]
Products
Total CPU difference: 7829.846191000003 / 7930.73203769996 [-1.27%]
Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

Test case is OK

git

2017-11-23 12:15

administrator   ~0072431

Branch CR29142_2 has been updated by szy.

SHA-1: bd7a28bd4bca3d6b71fb7e203dbf12f65701bb8a


Detailed log of new commits:

Author: szy
Date: Thu Nov 23 12:15:06 2017 +0300

    0029142: Exception on Redo.
    
    //Fix of the warning for VStudio 2017.

git

2017-12-07 21:07

administrator   ~0072793

Branch CR29142 has been deleted by kgv.

SHA-1: 22c7d0a5f3252f7f183ffba592e70f4e961ba358

git

2017-12-07 21:07

administrator   ~0072794

Branch CR29142_1 has been deleted by kgv.

SHA-1: 13dab595d386e5a3ceadbf574d1f9454c6c6429c

git

2017-12-07 21:07

administrator   ~0072795

Branch CR29142_2 has been deleted by kgv.

SHA-1: bd7a28bd4bca3d6b71fb7e203dbf12f65701bb8a

Related Changesets

occt: master a7378539

2017-11-20 14:31:15

szy


Committer: bugmaster Details Diff
0029142: Exception on Redo.

Order of attributes deltas is fixed.
Affected Issues
0029142
mod - src/TDF/TDF_Data.cxx Diff File
mod - src/TDF/TDF_Data.hxx Diff File
mod - src/TDF/TDF_Delta.hxx Diff File
mod - src/TDF/TDF_Delta.lxx Diff File
add - tests/bugs/caf/bug29142 Diff File

Issue History

Date Modified Username Field Change
2017-09-25 17:41 dbv New Issue
2017-09-25 17:41 dbv Assigned To => mpv
2017-09-25 17:41 dbv Relationship added related to 0028946
2017-09-25 17:42 dbv Steps to Reproduce Updated
2017-10-03 14:39 mpv Assigned To mpv => vro
2017-10-03 14:41 mpv Note Added: 0071153
2017-10-03 14:41 mpv Status new => assigned
2017-10-03 14:45 mpv Relationship added related to 0029116
2017-10-12 15:53 git Note Added: 0071372
2017-10-12 16:07 szy Note Added: 0071375
2017-10-12 16:07 szy Assigned To vro => mpv
2017-10-12 16:07 szy Status assigned => resolved
2017-10-12 17:06 git Note Added: 0071379
2017-10-16 09:23 mpv Note Added: 0071509
2017-10-16 09:23 mpv Assigned To mpv => szy
2017-10-16 09:23 mpv Status resolved => assigned
2017-11-15 17:39 git Note Added: 0072259
2017-11-15 17:44 szy Note Added: 0072261
2017-11-15 17:44 szy Assigned To szy => mpv
2017-11-15 17:44 szy Status assigned => resolved
2017-11-15 17:44 szy Steps to Reproduce Updated
2017-11-16 16:17 mpv Assigned To mpv => vro
2017-11-17 09:31 vro Note Added: 0072307
2017-11-17 09:31 vro Assigned To vro => mpv
2017-11-17 09:31 vro Status resolved => reviewed
2017-11-17 09:39 mpv Note Added: 0072309
2017-11-17 10:18 szy Note Added: 0072311
2017-11-20 16:25 szy Note Added: 0072337
2017-11-20 16:34 szy Assigned To mpv => bugmaster
2017-11-20 17:20 git Note Added: 0072340
2017-11-20 17:31 git Note Added: 0072341
2017-11-21 10:08 szy Note Added: 0072355
2017-11-21 11:54 bugmaster Test case number => bugs caf bug29142
2017-11-21 11:57 bugmaster Note Added: 0072358
2017-11-21 11:57 bugmaster Status reviewed => tested
2017-11-21 11:58 bugmaster Note Edited: 0072358
2017-11-23 12:15 git Note Added: 0072431
2017-11-25 12:28 bugmaster Changeset attached => occt master a7378539
2017-11-25 12:28 bugmaster Status tested => verified
2017-11-25 12:28 bugmaster Resolution open => fixed
2017-12-07 21:07 git Note Added: 0072793
2017-12-07 21:07 git Note Added: 0072794
2017-12-07 21:07 git Note Added: 0072795
2018-02-20 12:58 aiv Target Version 7.4.0 => 7.3.0
2018-03-01 15:02 dbv Relationship added related to 0029531
2018-06-20 11:08 Vico Liang Relationship added related to 0029884
2018-06-29 21:13 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed