View Issue Details

IDProjectCategoryView StatusLast Update
0025602Open CASCADEOCCT:Data Exchangepublic2021-08-31 14:37
ReporternbvAssigned Toskl  
PrioritynormalSeverityminor 
Status assignedResolutionopen 
Target VersionUnscheduled 
Summary0025602: Data Exchange - It is important for IGES and STEP file format to add check, if wrong data are read from the file
DescriptionIt is important for IGES and STEP file format to add check, if wrong data are read from the file. For example, if file contains number ~ 1.0e-314 (less than DBL_MIN) or Nan-numbers (see wrongnum.PNG file attached).
Steps To Reproducetest de step_1 E6

New test case is not required.
Additional information
and documentation updates
Just for the record:
Validity of numbers read can be checked by _fpclass(...) function. Its code is shown there: http://www.jbox.dk/sanos/source/lib/math.c.html [^]

Function _fpclass(...) is standard for Visual Studio but it is not supported by Linux-translators. The author of notice (http://www.johndcook.com/blog/ieee_exceptions_in_cpp/ [^]) advises to use fp_class_d(...) function on LINUX platform. But it is not supported, too.
TagsNo tags attached.
Test case number

Attached Files

  • wrongnum.PNG (42,270 bytes)

Relationships

related to 0025275 closedbugmaster Open CASCADE Different result of reading operation from *.igs and *.stp file for WINDOWS and LINUX platforms 
related to 0030875 closedabv Community Foundation Classes - BSplCLib crashes in case of infinite upper knot 

Activities

nbv

2014-12-12 16:29

developer  

wrongnum.PNG (42,270 bytes)

git

2014-12-30 16:59

administrator   ~0035905

Branch CR25602 has been created by nbv.

SHA-1: 1c202377655809dc8952ea3b3783664c08599a80


Detailed log of new commits:

Author: nbv
Date: Mon Dec 29 14:07:55 2014 +0300

    0025602: It is important for IGES and STEP file format to add check, if if wrong data are read from the file
    
    1. Functions Precision::IsIllegal(...) and Precision::IsInfinitesimal(...) were added.
    2. Detection incorrect numbers read from *.stp and/or *.igs files was added.
    3. Precision.cdl was deleted.
    4. New exception type "UnsupportedNumber" was created.

nbv

2014-12-30 17:07

developer   ~0035907

Dear Mikhail!

Please review CR25602 branch.

Before reviewing please pay attention to the your message http://tracker.dev.opencascade.org/view.php?id=25275#c35288.

Exception about illegal number is caught in Interface_FileReaderTool.cxx in the function Interface_FileReaderTool::LoadModel(const Handle(Interface_InterfaceModel)&).
There, for every error type special status is set (e.g. "XSTEP_21"). This status is decrypted in \src\XSMessage\XSTEP.* resource file. Entity with error will be ignored.

abv

2015-01-01 15:34

manager   ~0035916

My remarks:

1. Please roll back changes that are not related to the fix, such as conversion of package Precision to non-CDL and reformatting StepData_StepReaderData.cxx. Besides, have you tried building this? I guess WOK should fail to compile Precise due to absence of CDL.

2. Please explain why not using standard fpclass() function but inventing your own instead.

3. Instead of checking result of Atof() and Interface_FileReaderData::Fastof() in 6 places, why not introducing relevant check in these functions?

nbv

2015-01-12 10:28

developer   ~0035944

Dear Andrey!

1. Problems with compilation are absent, it has been checked.

2. Please read the message message http://tracker.dev.opencascade.org/view.php?id=25275#c35288. "The lines 543-552 have wrong indentation...". There is no point in correcting indentation without code reformatting, is there?

3. See Additional information to the bug: "Function _fpclass(...) is standard for Visual Studio but it is not supported by Linux-translators..."

4. In my point of view, Atof() and Interface_FileReaderData::Fastof() functions must read (and convert) all values correctly (without any exceptions). E.g. why should we throw an exception in Atof() function, if it reads number 3e+101? We should not. Usually, it is a good value. It is bad for shapes dimension only.

msv

2015-01-12 10:59

developer   ~0035945

I agree with abv's remarks.
My addition: please indent the definition of new exception UnsupportedNumber to be the same as of other inherited NumericError.

msv

2015-01-12 11:26

developer   ~0035946

Concerning point 2, "There is no point in correcting indentation without code reformatting".
1. Please do not make any formatting modifications in the code that you are not modifying.
2. When you are modifying a code, please try to make as few changes as possible.

git

2015-07-29 14:27

administrator   ~0043676

Branch CR25602 has been updated forcibly by nbv.

SHA-1: 6eb75c4569698e789eff65a9cc9b3693c149a539

git

2015-07-29 16:13

administrator   ~0043681

Branch CR25602 has been updated forcibly by nbv.

SHA-1: a80b728177f59e6a2f64d5153087d89aaf694e0f

Issue History

Date Modified Username Field Change
2014-12-12 16:29 nbv New Issue
2014-12-12 16:29 nbv Assigned To => nbv
2014-12-12 16:29 nbv File Added: wrongnum.PNG
2014-12-12 16:32 nbv Additional Information Updated
2014-12-12 16:32 nbv Relationship added related to 0025275
2014-12-13 16:41 msv Summary It is important for IGES and STEP file format to add check, if if wrong data are read from the file => It is important for IGES and STEP file format to add check, if wrong data are read from the file
2014-12-13 16:41 msv Description Updated
2014-12-30 15:42 nbv Status new => assigned
2014-12-30 16:59 git Note Added: 0035905
2014-12-30 17:07 nbv Note Added: 0035907
2014-12-30 17:07 nbv Assigned To nbv => msv
2014-12-30 17:07 nbv Status assigned => resolved
2015-01-01 15:34 abv Note Added: 0035916
2015-01-01 15:34 abv Assigned To msv => nbv
2015-01-01 15:34 abv Status resolved => assigned
2015-01-12 10:28 nbv Note Added: 0035944
2015-01-12 10:29 nbv Assigned To nbv => abv
2015-01-12 10:29 nbv Status assigned => feedback
2015-01-12 10:59 msv Note Added: 0035945
2015-01-12 11:26 msv Note Added: 0035946
2015-01-12 11:41 msv Assigned To abv => nbv
2015-01-12 11:41 msv Status feedback => assigned
2015-04-06 16:58 abv Target Version 6.9.0 => 7.1.0
2015-07-29 14:27 git Note Added: 0043676
2015-07-29 16:13 git Note Added: 0043681
2016-10-26 20:00 gka Target Version 7.1.0 => 7.2.0
2017-07-27 09:33 abv Target Version 7.2.0 => 7.4.0
2019-08-13 12:57 kgv Relationship added related to 0030875
2019-08-13 12:57 kgv Assigned To nbv => gka
2019-08-16 10:52 kgv Summary It is important for IGES and STEP file format to add check, if wrong data are read from the file => Data Exchange - It is important for IGES and STEP file format to add check, if wrong data are read from the file
2019-09-12 23:09 abv Target Version 7.4.0 => 7.5.0
2020-09-17 20:14 gka Target Version 7.5.0 => 7.6.0
2020-11-20 15:03 szy Assigned To gka => skl
2021-08-31 14:37 gka Target Version 7.6.0 => Unscheduled