MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029142Open CASCADE[OCCT] OCCT:Application Frameworkpublic2017-09-25 17:412017-12-07 21:07
Reporterdbv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.3.0*Fixed in Version 
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
Attached Files

- Relationships
related to 0028946closedbugmaster Open CASCADE Exception on Undo 
related to 0029116assignedvro Community [Regression] OCAF attributes insertion order is violated again 

-  Notes
(0071153)
mpv (developer)
2017-10-03 14:41

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.
(0071372)
git (administrator)
2017-10-12 15:53

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
(0071375)
szy (developer)
2017-10-12 16:07

The issue is fixed by taken into account 'forgotten' status of the attribute.
Review it, please. After I will check it with Jenkins.
(0071379)
git (administrator)
2017-10-12 17:06

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.

(0071509)
mpv (developer)
2017-10-16 09:23

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.
(0072259)
git (administrator)
2017-11-15 17:39

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
(0072261)
szy (developer)
2017-11-15 17:44

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.
(0072307)
vro (developer)
2017-11-17 09:31

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?
(0072309)
mpv (developer)
2017-11-17 09:39

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).
(0072311)
szy (developer)
2017-11-17 10:18

I prefer to present the idea face to face to avoid useless writing.
Let's meet next week and discuss the idea.
(0072337)
szy (developer)
2017-11-20 16:25

Tested - http://jenkins-test-10.nnov.opencascade.com/view/CR29142-master/. [^]
(0072340)
git (administrator)
2017-11-20 17:20

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

(0072341)
git (administrator)
2017-11-20 17:31

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.
(0072355)
szy (developer)
2017-11-21 10:08

Tested CR29142_2: => http://jenkins-test-10.nnov.opencascade.com/view/CR29142-master/. [^]
(0072358)
bugmaster (administrator)
2017-11-21 11:57
edited on: 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

(0072431)
git (administrator)
2017-11-23 12:15

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.

(0072793)
git (administrator)
2017-12-07 21:07

Branch CR29142 has been deleted by kgv.

SHA-1: 22c7d0a5f3252f7f183ffba592e70f4e961ba358
(0072794)
git (administrator)
2017-12-07 21:07

Branch CR29142_1 has been deleted by kgv.

SHA-1: 13dab595d386e5a3ceadbf574d1f9454c6c6429c
(0072795)
git (administrator)
2017-12-07 21:07

Branch CR29142_2 has been deleted by kgv.

SHA-1: bd7a28bd4bca3d6b71fb7e203dbf12f65701bb8a

- Related Changesets
occt: master a7378539
Timestamp: 2017-11-20 14:31:15
Author: szy
Committer: bugmaster
Details ] Diff ]
0029142: Exception on Redo.

Order of attributes deltas is fixed.
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 View Revisions
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 View Revisions
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 View Revisions
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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker