View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027194 | Open CASCADE | OCCT:Modeling Algorithms | public | 2016-02-20 11:44 | 2016-12-09 16:37 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.9.1 | ||||
Target Version | 7.1.0 | Fixed in Version | 7.1.0 | ||
Summary | 0027194: Possible division by zero in IntPatch_WLineTool | ||||
Description | This 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 Reproduce | test bugs moddata_2 bug469 | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
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 |
|
Dear msv, Please check current state of the branch CR27194. |
|
Reviewed. |
|
Branch CR27194 has been updated forcibly by mkv. SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c |
|
Dear BugMaster, Branch CR27194 was rebased on current master of occt git-repository. SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c |
|
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. |
|
Dear BugMaster, Branch CR27194 is TESTED. |
|
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). |
|
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. |
|
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. |
|
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 |
|
Dear abv, Please check current state of the CR27194_2 branch. |
|
No remarks, please test |
|
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. |
|
Dear BugMaster, Branch CR27194_2 is TESTED. |
|
Branch CR27194_2 has been deleted by inv. SHA-1: 53048499310b606d35639eb94af83ad76d031083 |
|
Branch CR27194 has been deleted by inv. SHA-1: 1c61ca27c396b2da5630f3ba07446ec366bad51c |
occt: master 871776ea 2016-02-20 08:54:44
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 |
Affected Issues 0027194 |
|
mod - src/IntPatch/IntPatch_WLineTool.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-02-20 11:44 |
|
New Issue | |
2016-02-20 11:44 |
|
Assigned To | => aml |
2016-02-20 11:45 |
|
Relationship added | child of 0026329 |
2016-02-20 13:39 | git | Note Added: 0051039 | |
2016-02-20 13:48 |
|
Note Added: 0051040 | |
2016-02-20 13:48 |
|
Assigned To | aml => msv |
2016-02-20 13:48 |
|
Status | new => resolved |
2016-02-20 19:10 |
|
Note Added: 0051051 | |
2016-02-20 19:10 |
|
Assigned To | msv => bugmaster |
2016-02-20 19:10 |
|
Status | resolved => reviewed |
2016-02-24 16:04 |
|
Assigned To | bugmaster => mkv |
2016-02-24 19:19 | git | Note Added: 0051091 | |
2016-02-25 17:14 |
|
Note Added: 0051131 | |
2016-02-25 17:14 |
|
Note Added: 0051132 | |
2016-02-25 17:14 |
|
Note Added: 0051133 | |
2016-02-25 17:14 |
|
Assigned To | mkv => bugmaster |
2016-02-25 17:14 |
|
Status | reviewed => tested |
2016-02-25 17:14 |
|
Test case number | => Not needed |
2016-03-25 10:50 | bugmaster | Target Version | 7.1.0 => 7.0.0 |
2016-03-28 13:19 |
|
Note Added: 0052064 | |
2016-03-28 13:42 |
|
Note Added: 0052065 | |
2016-03-28 14:39 |
|
Note Added: 0052067 | |
2016-03-28 17:22 |
|
Target Version | 7.0.0 => 7.1.0 |
2016-04-07 16:46 |
|
Assigned To | bugmaster => abv |
2016-04-07 16:46 |
|
Status | tested => feedback |
2016-05-18 09:35 | git | Note Added: 0054098 | |
2016-05-18 09:36 |
|
Note Added: 0054099 | |
2016-05-18 09:36 |
|
Status | feedback => resolved |
2016-05-18 09:38 |
|
Note Added: 0054100 | |
2016-05-18 09:38 |
|
Assigned To | abv => bugmaster |
2016-05-18 09:38 |
|
Status | resolved => reviewed |
2016-05-18 14:55 |
|
Assigned To | bugmaster => mkv |
2016-05-19 11:27 |
|
Note Added: 0054124 | |
2016-05-19 11:27 |
|
Note Added: 0054125 | |
2016-05-19 11:27 |
|
Assigned To | mkv => bugmaster |
2016-05-19 11:27 |
|
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 |
|
Status | verified => closed |
2016-12-09 16:37 |
|
Fixed in Version | => 7.1.0 |