MantisBT - Community
View Issue Details
0029116Community[OCCT] OCCT:Application Frameworkpublic2017-09-15 12:122018-06-23 13:56
Roman Lygin 
bugmaster 
normalminor 
closedfixed 
[OCCT] 7.2.0 
[OCCT] 7.4.0[OCCT] 7.4.0 
caf/basic/B8
0029116: [Regression] OCAF attributes insertion order is violated again
7.2.0 has introduced a regression reported as 0024755 and which was fixed in 6.8.0.
The following test case failed when running under 7.2.0:

/*! Regression test for id 24755.*/
void TDF_LabelTest::AddAttribute()
{
    Handle(TDocStd_Application) anApp = new AppStdL_Application;
    Handle(TDocStd_Document) aDoc;
    anApp->NewDocument ("MDTV-Standard", aDoc);
    TDF_Label aLab = aDoc->Main();
    TDataStd_Integer::Set (aLab, 0);
    TDataStd_Name::Set (aLab, "test");

    Standard_Boolean anIsInteger = Standard_True, anIsName = Standard_True;

#if OCC_VERSION_HEX > 0x060701
    TDF_AttributeIterator i (aLab);
    Handle(TDF_Attribute) anAttr = i.Value();
    anIsInteger = anAttr->IsKind (STANDARD_TYPE (TDataStd_Integer));
    i.Next();
    anAttr = i.Value();
    anIsName = anAttr->IsKind (STANDARD_TYPE (TDataStd_Name));
#endif
    //defer check to after close
    anApp->Close (aDoc);
    QVERIFY (anIsInteger);
    QVERIFY (anIsName);
}

See description
No tags attached.
related to 0024755closed mpv Community TDF_Label::AddAttribute() reverses the order of added attributes 
related to 0028908closed bugmaster Open CASCADE Improvement on attachment of attributes to the label 
related to 0028946closed bugmaster Open CASCADE Exception on Undo 
related to 0029142closed bugmaster Open CASCADE Exception on Redo 
Issue History
2017-09-15 12:12Roman LyginNew Issue
2017-09-15 12:12Roman LyginAssigned To => mpv
2017-09-15 12:12Roman LyginRelationship addedrelated to 0024755
2017-09-15 14:52mpvRelationship addedrelated to 0028908
2017-09-15 14:53mpvRelationship addedrelated to 0028946
2017-09-15 14:55mpvNote Added: 0070587
2017-09-15 15:13mpvStatusnew => resolved
2017-09-15 15:13mpvResolutionopen => won't fix
2017-09-15 15:13mpvStatusresolved => reviewed
2017-09-15 15:19mpvNote Added: 0070589
2017-09-15 15:38mpvNote Added: 0070593
2017-09-15 15:38mpvStatusreviewed => assigned
2017-10-03 14:43mpvAssigned Tompv => vro
2017-10-03 14:44mpvNote Added: 0071154
2017-10-03 14:45mpvRelationship addedrelated to 0029142
2018-04-03 12:26vroRelationship addedrelated to 0029669
2018-06-04 10:47gitNote Added: 0076570
2018-06-04 14:27vroNote Added: 0076588
2018-06-04 14:27vroAssigned Tovro => szy
2018-06-04 14:27vroStatusassigned => resolved
2018-06-04 14:50szyNote Added: 0076590
2018-06-04 14:50szyAssigned Toszy => bugmaster
2018-06-04 14:50szyStatusresolved => reviewed
2018-06-04 17:00bugmasterTest case number => caf/basic/B8
2018-06-04 18:02bugmasterNote Added: 0076598
2018-06-04 18:02bugmasterStatusreviewed => tested
2018-06-14 18:20bugmasterChangeset attached => occt master bd6f0d2f
2018-06-14 18:20bugmasterStatustested => verified
2018-06-14 18:20bugmasterResolutionwon't fix => fixed
2018-06-23 13:56gitNote Added: 0076894

Notes
(0070587)
mpv   
2017-09-15 14:55   
Fix of 24755 produced regression 28946, whis is why it was rolled-back.
(0070589)
mpv   
2017-09-15 15:19   
"Undo" functionality is based on reversed order of attributes on the label: it adds/removes attributes in the reversed order they were removed/added.

So, this problem has the higher piority than request 24755. Also, changing "undo" algorithm will poduce loss of performance.

Anyway, developer may use the append flag of TDF_Label::AddAttribute to reproduce the needed order. But in this case he must be sure that he does not remove and then add attribute to the same label in the same transactio. Otherwise this may cause crash on "Undo".
(0070593)
mpv   
2017-09-15 15:38   
Ok, after some discussions it is decided to think again about this problem. May be the order of attributes may be reverted during open or save of the document to keep the document's content same each time. Perhaps performance become not so bad.
(0071154)
mpv   
2017-10-03 14:44   
Due to 29142 probably the order of appended attributes may be restored.
(0076570)
git   
2018-06-04 10:47   
Branch CR29116 has been created by vro.

SHA-1: 2625fc09b4bdb8eb425ec6d0e517dc2145c4fe33


Detailed log of new commits:

Author: vro
Date: Mon Jun 4 10:47:18 2018 +0300

    0029116: [Regression] OCAF attributes insertion order is violated again
(0076588)
vro   
2018-06-04 14:27   
Dear Sergey, could you review please?: http://jenkins-test-11.nnov.opencascade.com/view/CR29116-master-vro/view/TESTING/. [^] There is some instability in jenkins in strtod() and reading DXF test-cases, ignore please.
(0076590)
szy   
2018-06-04 14:50   
Reviewed.
(0076598)
bugmaster   
2018-06-04 18:02   
Combination -
OCCT branch : CR29116 SHA - 2625fc09b4bdb8eb425ec6d0e517dc2145c4fe33
Products branch : master SHA - 82570c1f4b0e27eb09789f573087eef089260f59
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 17096.14999999993 / 17011.039999999866 [+0.50%]
Products
Total CPU difference: 7487.140000000035 / 7518.570000000041 [-0.42%]
Windows-64-VC10:
OCCT
Total CPU difference: 16816.970200398548 / 16821.806231398525 [-0.03%]
Products
Total CPU difference: 8228.771948199888 / 8176.012409999883 [+0.65%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0076894)
git   
2018-06-23 13:56   
Branch CR29116 has been deleted by kgv.

SHA-1: 2625fc09b4bdb8eb425ec6d0e517dc2145c4fe33