MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027194Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2016-02-20 11:442016-12-09 16:37
Reporteraml 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.9.1 
Target Version[OCCT] 7.1.0Fixed in Version[OCCT] 7.1.0 
Summary0027194: Possible division by zero in IntPatch_WLineTool
DescriptionThis issue is observed in scope of the 0026329 bug.

aStepCoeff = Min(aStepOnS1, aStepOnS2) / Max(aStepOnS1, aStepOnS2);

Such division may lead to the problems when aStepOnS1 and aStepOnS2 are equal to 0.0.

It is necessary to investigate how this situation may happen and elaborate solution. Problem can be reproduced on the CR26329 branch only.
Steps To Reproducetest bugs moddata_2 bug469
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships
child of 0026329closedkgv Restore floating point signals handling in DRAW 

-  Notes
(0051039)
git (administrator)
2016-02-20 13:39

Branch CR27194 has been created by aml.

SHA-1: 344d80fce487cc9b5014bb20417a47a415b183bd


Detailed log of new commits:

Author: aml
Date: Sat Feb 20 11:54:44 2016 +0300

    0027194: Possible division by zero in IntPatch_WLineTool
    
    Correct handling for division by zero is added. This prevents exception when FPE is enabled
(0051040)
aml (developer)
2016-02-20 13:48

Dear msv,
Please check current state of the branch CR27194.
(0051051)
msv (developer)
2016-02-20 19:10

Reviewed.
(0051091)
git (administrator)
2016-02-24 19:19

Branch CR27194 has been updated forcibly by mkv.

SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c
(0051131)
mkv (tester)
2016-02-25 17:14

Dear BugMaster,
Branch CR27194 was rebased on current master of occt git-repository.
SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c
(0051132)
mkv (tester)
2016-02-25 17:14

Dear BugMaster,
Branch CR27194 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 41 (41 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 90157515 / 90534753 [-0.42%]
Total CPU difference: 19392.780000000017 / 19576.420000000107 [-0.94%]
products component :
Total MEMORY difference: 25923801 / 25872807 [+0.20%]
Total CPU difference: 5361.569999999991 / 5316.139999999985 [+0.85%]

Testing on Windows:
occt component :
Total MEMORY difference: 57375213 / 57106337 [+0.47%]
Total CPU difference: 18744.31575509885 / 17710.10712559875 [+5.84%]
products component :
Total MEMORY difference: 17493005 / 17395600 [+0.56%]
Total CPU difference: 5411.159886699964 / 5095.257861699954 [+6.20%]

There are no differences in images found by testdiff.
(0051133)
mkv (tester)
2016-02-25 17:14

Dear BugMaster,
Branch CR27194 is TESTED.
(0052064)
abv (manager)
2016-03-28 13:19

Remarks on proposed fix:

1. Please avoid comparing real numbers for equality using operator == or != -- this will not work in general case. For instance, AFAIK, -0 != +0

2. In order to protect against division by zero, it would be sufficient to check the value of Max(aStepOnS1, aStepOnS2), so why checking both aStepOnS1 and aStepOnS2 individually?

3. What happens if aStepOnS1=1e-308 and aStepOnS2 = 10? Should not the behavior be the same as when aStepOnS1=0. and aStepOnS2=1.? (currently it will be different).
(0052065)
aml (developer)
2016-03-28 13:42

1. Please avoid comparing real numbers for equality using operator == or != -- this will not work in general case. For instance, AFAIK, -0 != +0

if (+0.0 == -0.0)
 cout << "EQUAL";

Returns true in MSVC2010. Here only +0.0 is used due to values nature.

2. In order to protect against division by zero, it would be sufficient to check the value of Max(aStepOnS1, aStepOnS2), so why checking both aStepOnS1 and aStepOnS2 individually?

Max(aStepOnS1, aStepOnS2) is not computed directly.

3. What happens if aStepOnS1=1e-308 and aStepOnS2 = 10? Should not the behavior be the same as when aStepOnS1=0. and aStepOnS2=1.? (currently it will be different).

Denormal numbers will be used.
(0052067)
msv (developer)
2016-03-28 14:39

1. I agree. It is better to compare with gp::Resolution(), that is RealSmall().

2. Checking of Max only is not enough, we must check also Min.

3. If we check both values this will not happen.
(0054098)
git (administrator)
2016-05-18 09:35

Branch CR27194_2 has been created by aml.

SHA-1: 53048499310b606d35639eb94af83ad76d031083


Detailed log of new commits:

Author: aml
Date: Sat Feb 20 11:54:44 2016 +0300

    0027194: Possible division by zero in IntPatch_WLineTool
    
    Correct handling for division by zero is added. This prevents exception when FPE is enabled
(0054099)
aml (developer)
2016-05-18 09:36

Dear abv,
Please check current state of the CR27194_2 branch.
(0054100)
abv (manager)
2016-05-18 09:38

No remarks, please test
(0054124)
mkv (tester)
2016-05-19 11:27

Dear BugMaster,
Branch CR27194_2 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 53048499310b606d35639eb94af83ad76d031083

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 72 (72 on master)
Windows: 4 (4 on master)
MacOS : 1144

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 88283719 / 87385561 [+1.03%]
Total CPU difference: 19284.279999999915 / 19257.83 [+0.14%]
products component :
Total MEMORY difference: 27790493 / 27718261 [+0.26%]
Total CPU difference: 5231.579999999983 / 5200.899999999987 [+0.59%]

Testing on Windows:
occt component :
Total MEMORY difference: 55779341 / 55791306 [-0.02%]
Total CPU difference: 18062.716185898837 / 17814.222192998932 [+1.39%]
products component :
Total MEMORY difference: 18925839 / 18889957 [+0.19%]
Total CPU difference: 5175.707577399963 / 4958.179782999945 [+4.39%]

There are no differences in images found by testdiff.
(0054125)
mkv (tester)
2016-05-19 11:27

Dear BugMaster,
Branch CR27194_2 is TESTED.
(0054169)
git (administrator)
2016-05-20 12:20

Branch CR27194_2 has been deleted by inv.

SHA-1: 53048499310b606d35639eb94af83ad76d031083
(0054233)
git (administrator)
2016-05-20 12:24

Branch CR27194 has been deleted by inv.

SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c

- Related Changesets
occt: master 871776ea
Timestamp: 2016-02-20 08:54:44
Author: aml
Committer: bugmaster
Details ] Diff ]
0027194: Possible division by zero in IntPatch_WLineTool

Correct handling for division by zero is added. This prevents exception when FPE is enabled
mod - src/IntPatch/IntPatch_WLineTool.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2016-02-20 11:44 aml New Issue
2016-02-20 11:44 aml Assigned To => aml
2016-02-20 11:45 aml Relationship added child of 0026329
2016-02-20 13:39 git Note Added: 0051039
2016-02-20 13:48 aml Note Added: 0051040
2016-02-20 13:48 aml Assigned To aml => msv
2016-02-20 13:48 aml Status new => resolved
2016-02-20 19:10 msv Note Added: 0051051
2016-02-20 19:10 msv Assigned To msv => bugmaster
2016-02-20 19:10 msv Status resolved => reviewed
2016-02-24 16:04 mkv Assigned To bugmaster => mkv
2016-02-24 19:19 git Note Added: 0051091
2016-02-25 17:14 mkv Note Added: 0051131
2016-02-25 17:14 mkv Note Added: 0051132
2016-02-25 17:14 mkv Note Added: 0051133
2016-02-25 17:14 mkv Assigned To mkv => bugmaster
2016-02-25 17:14 mkv Status reviewed => tested
2016-02-25 17:14 mkv Test case number => Not needed
2016-03-25 10:50 bugmaster Target Version 7.1.0 => 7.0.0
2016-03-28 13:19 abv Note Added: 0052064
2016-03-28 13:42 aml Note Added: 0052065
2016-03-28 14:39 msv Note Added: 0052067
2016-03-28 17:22 abv Target Version 7.0.0 => 7.1.0
2016-04-07 16:46 abv Assigned To bugmaster => abv
2016-04-07 16:46 abv Status tested => feedback
2016-05-18 09:35 git Note Added: 0054098
2016-05-18 09:36 aml Note Added: 0054099
2016-05-18 09:36 aml Status feedback => resolved
2016-05-18 09:38 abv Note Added: 0054100
2016-05-18 09:38 abv Assigned To abv => bugmaster
2016-05-18 09:38 abv Status resolved => reviewed
2016-05-18 14:55 mkv Assigned To bugmaster => mkv
2016-05-19 11:27 mkv Note Added: 0054124
2016-05-19 11:27 mkv Note Added: 0054125
2016-05-19 11:27 mkv Assigned To mkv => bugmaster
2016-05-19 11:27 mkv Status reviewed => tested
2016-05-20 11:18 bugmaster Changeset attached => occt master 871776ea
2016-05-20 11:18 bugmaster Status tested => verified
2016-05-20 11:18 bugmaster Resolution open => fixed
2016-05-20 12:20 git Note Added: 0054169
2016-05-20 12:24 git Note Added: 0054233
2016-12-09 16:31 user533 Status verified => closed
2016-12-09 16:37 user533 Fixed in Version => 7.1.0


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker