MantisBT - Open CASCADE
View Issue Details
0027185Open CASCADE[OCCT] OCCT:Data Exchangepublic2016-02-18 18:432020-09-20 11:13
abv 
bugmaster 
normalminor 
verifiedfixed 
 
[OCCT] 7.5.0 
de iges_2 F9
0027185: Data Exchange - IGES - incorrect reading of DE for undefined entity
Method IGESData_UndefinedEntity::ReadDir() incorrectly treats negative value of color number (field 13): error is generated, while negative value should be resolved to a Color Definition Entity.

This is due to error in the code (apparently copy-paste nature):

~~~~~
  iapb = Standard_False;
  if (v[14] < 0 || v[14] > max) iapb = Standard_True;
  else if (v[14] < 0) {
    anent = GetCasted(IGESData_IGESEntity,IR->BoundEntity((1+v[14])/2));
    if (!anent->IsKind(STANDARD_TYPE(IGESData_ColorEntity)))
      { thedstat += 512; v[14] = 0; }
  }
  
  // Sending of message : Color Number field is incorrect.
  if (iapb) {

~~~~~

This code will never read entity.
Here positive value of color index should indicate predefined color, while negative is a reference to color definition entity.

The same problem seem to be with reading some other fields in that class, e.g. Label Display Entity.

The issue is detected during analysis of regressions on branch CR27111_6.
It causes additional failure message reported by by "data c" command on first file loading in test de iges_2 F9:

 1 F:122 0 TabulatedCylinder : Directory Entry (Field 13) : Color Number field is incorrect (Pointer or Integer between 0 and 8 was expected).
test de iges_2 F9
test bugs iges bug27186
No tags attached.
related to 0026377closed abv Open CASCADE Passing Handle objects as arguments to functions as non-const reference to base type is dangerous 
related to 0027111closed abv Community Add generalized copy constructor in handle class for old compilers 
related to 0027186new gka Open CASCADE IGES - reconsider creation of Undefined entity in case of failure 
Issue History
2016-02-18 18:43abvNew Issue
2016-02-18 18:43abvAssigned To => gka
2016-02-18 18:59abvRelationship addedrelated to 0027186
2016-02-18 18:59abvRelationship addedrelated to 0027111
2016-02-18 18:59abvRelationship deletedrelated to 0027111
2016-02-18 19:00abvRelationship addedrelated to 0026377
2016-10-26 11:09gkaTarget Version7.1.0 => 7.2.0
2017-07-27 09:24abvTarget Version7.2.0 => 7.4.0
2017-08-18 14:40mkvTest case number => de iges_2 F9
2017-08-18 14:40mkvNote Added: 0069579
2019-07-10 22:20abvRelationship addedrelated to 0027111
2019-09-04 15:54abvTarget Version7.4.0 => 7.5.0
2020-09-14 12:37gkaAssigned Togka => ika
2020-09-14 12:37gkaStatusnew => assigned
2020-09-15 17:18gitNote Added: 0094866
2020-09-16 11:56ikaNote Added: 0094902
2020-09-16 11:56ikaAssigned Toika => gka
2020-09-16 11:56ikaStatusassigned => resolved
2020-09-16 11:56ikaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=23490#r23490
2020-09-18 14:30gkaNote Added: 0095029
2020-09-18 14:30gkaAssigned Togka => bugmaster
2020-09-18 14:30gkaStatusresolved => reviewed
2020-09-18 18:12bugmasterSummaryIGES - incorrect reading of DE for undefined entity => Data Exchange - IGES - incorrect reading of DE for undefined entity
2020-09-19 17:19bugmasterNote Added: 0095060
2020-09-19 17:19bugmasterStatusreviewed => tested
2020-09-20 10:55bugmasterChangeset attached => occt master b0b76682
2020-09-20 10:55bugmasterStatustested => verified
2020-09-20 10:55bugmasterResolutionopen => fixed
2020-09-20 11:13gitNote Added: 0095115

Notes
(0069579)
mkv   
2017-08-18 14:40   
Problem described in issue is reproduced on current state of OCCT.
(0094866)
git   
2020-09-15 17:18   
Branch CR27185 has been created by ika.

SHA-1: e5695540512a76dbb242c8c29b437cab6a99f240


Detailed log of new commits:

Author: ika
Date: Tue Sep 15 17:20:35 2020 +0300

    0027185: IGES - incorrect reading of DE for undefined entity
    
    Fix reading of pointers to color entity.
(0094902)
ika   
2020-09-16 11:56   
Dear GKA,

could you please review branch CR27185?

http://occt-tests/CR27185-master-ika-OCCT/Debian80-64/diff_summary.html [^]
http://occt-tests/CR27185-master-ika-OCCT/Windows-64-VC14/diff_summary.html [^]
http://occt-tests/CR27185-master-ika-Products/Debian80-64/diff_summary.html [^]
http://occt-tests/CR27185-master-ika-Products/Windows-64-VC14/diff_summary.html [^]
(0095029)
gka   
2020-09-18 14:30   
Branch CR27185 was reviewed
(0095060)
bugmaster   
2020-09-19 17:19   
Combination -
OCCT branch : IR-2020-09-18
master SHA - b0b766826118f74b9857a932b8cec8c52a25c492
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-09-18 SHA - a6486d839da1ba1383ef6cc1a1a446a172f494c7
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:
Debian80-64:
OCCT
Total CPU difference: 17528.97000000011 / 17378.390000000145 [+0.87%]
Products
Total CPU difference: 12127.32000000009 / 12079.540000000095 [+0.40%]
Windows-64-VC14:
OCCT
Total CPU difference: 18862.703125 / 18898.921875 [-0.19%]
Products
Total CPU difference: 13314.828125 / 13329.21875 [-0.11%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0095115)
git   
2020-09-20 11:13   
Branch CR27185 has been deleted by inv.

SHA-1: e5695540512a76dbb242c8c29b437cab6a99f240