View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031585 | Community | OCCT:Modeling Algorithms | public | 2020-05-30 16:55 | 2023-03-19 18:48 |
Reporter | abdullah | Assigned To | chennes | ||
Priority | normal | Severity | crash | ||
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Debian 6.0 | ||
Product Version | 7.3.0 | ||||
Target Version | 7.6.2 | Fixed in Version | 7.6.2 | ||
Summary | 0031585: Access Violation while creating fillet - ChFi3d_Builder::PerformIntersectionAtEnd | ||||
Description | This bug is reported against, git commit ae58f70718a089f84178d45a1bf9bee586d52d80 (master branch on 30 may 2020, OCC_VERSION 7.4.1). It is also present in 7.3.0. I attach a patch as a possible solution. In: void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) TopoDS_Edge Edge[nn]; is defined with: const Standard_Integer nn=15; At line 2020, in the loop "while (!trouve)" there is no check of the index nb used for array "Edge", in the example described below, nb takes value 15 => Edge[15] which causes an Access Violation. I have not investigated the actual reason why it is not found. The possible solution I propose is to check the index and throw an exception to avoid the crash. | ||||
Steps To Reproduce | The original bug submitter notes that creating a test case in Draw is difficult, and that the error was reproduced by running FreeCAD with a particular test case. The downstream ticket may be found at https://github.com/FreeCAD/FreeCAD/issues/5634 | ||||
Additional information and documentation updates | diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx index 369d4dcd7a..339b662691 100644 --- a/src/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx @@ -2020,0 +2021 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) + if (nb>=nn) throw Standard_Failure("IntersectionAtEnd : the max number of edges reached"); | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR31585 has been created by chennes. SHA-1: b0a5939a3dcddae4ed4edba4d1b56071282fcf4c Detailed log of new commits: Author: Chris Hennes Date: Sat Feb 12 18:52:19 2022 -0600 0031585: Access Violation while creating fillet - ChiFi3d_Builder::PerformIntersectionAtEnd There is one case in PerformIntersectionAtEnd that did not test whether an array access exceeded the length of the array, in rare cases resulting in a segmentation fault. That error-handling behavior is replaced by the exception code used elsewhere in the function. For consistency, the code is copied exactly as implemented elsewhere. This code has the same effect as that proposed by the bug submitter. |
|
Rather than directly use the patch proposed by the bug submitter, for consistency I copied a line from earlier in the same function that was making this check and throwing the exception. It uses an older code style (matching the rest of the file), and is throwing a very generic exception. It may be more appropriate to use the more modern coding style, and a more specific exception type, such as Standard_ConstructionError. |
|
Test job http://jenkins-test-occt/view/CR31585-master-MSV/view/COMPARE/ |
|
For integration: occt - CR31585 products - none |
|
Combination - OCCT branch : IR-2022-02-18 master SHA - 600ee856316c1a9eb340779b32de511b74465896 49e51745631c52b6c452c65adae4d6dfa21a1b1e Products branch : IR-2022-02-18 SHA - 859115827d7f98f21dc3e653fecea4c712aae052 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: 18496.730000000363 / 18543.560000000383 [-0.25%] Products Total CPU difference: 11705.020000000135 / 11696.60000000009 [+0.07%] Windows-64-VC14: OCCT Total CPU difference: 20453.203125 / 20387.28125 [+0.32%] Products Total CPU difference: 13176.3125 / 13150.390625 [+0.20%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR31585 has been deleted by mnt. SHA-1: b0a5939a3dcddae4ed4edba4d1b56071282fcf4c |
occt: master f91202f3 2022-02-13 03:52:19 Committer: |
0031585: Access Violation while creating fillet - ChiFi3d_Builder::PerformIntersectionAtEnd There is one case in PerformIntersectionAtEnd that did not test whether an array access exceeded the length of the array, in rare cases resulting in a segmentation fault. That error-handling behavior is replaced by the exception code used elsewhere in the function. For consistency, the code is copied exactly as implemented elsewhere. This code has the same effect as that proposed by the bug submitter. |
Affected Issues 0031585 |
|
mod - src/ChFi3d/ChFi3d_Builder_C1.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-05-30 16:55 | abdullah | New Issue | |
2020-05-30 16:55 | abdullah | Assigned To | => msv |
2022-02-13 03:58 | git | Note Added: 0106877 | |
2022-02-13 04:06 | chennes | Status | new => resolved |
2022-02-13 04:06 | chennes | Steps to Reproduce Updated | |
2022-02-13 04:06 | chennes | Note Added: 0106878 | |
2022-02-14 10:17 |
|
Note Added: 0106883 | |
2022-02-14 12:29 |
|
Assigned To | msv => bugmaster |
2022-02-14 12:29 |
|
Status | resolved => reviewed |
2022-02-14 12:29 |
|
Note Added: 0106888 | |
2022-02-19 11:34 |
|
Status | reviewed => tested |
2022-02-19 11:34 |
|
Note Added: 0106983 | |
2022-02-19 11:37 |
|
Test case number | => Not required |
2022-02-19 12:43 |
|
Changeset attached | => occt master f91202f3 |
2022-02-19 12:43 | chennes | Assigned To | bugmaster => chennes |
2022-02-19 12:43 | chennes | Status | tested => verified |
2022-02-19 12:43 | chennes | Resolution | open => fixed |
2022-02-19 12:57 | git | Note Added: 0106989 | |
2022-03-17 09:11 |
|
Target Version | => 7.6.2 |
2023-03-19 18:48 | vglukhik | Status | verified => closed |
2023-03-19 18:48 | vglukhik | Fixed in Version | => 7.6.2 |