View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026230 | Community | OCCT:Modeling Algorithms | public | 2015-05-18 16:13 | 2015-10-23 20:51 |
Reporter | BenjaminBihler | Assigned To | bugmaster | ||
Priority | normal | Severity | crash | ||
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Debian 6.0 | ||
Product Version | 6.7.1 | ||||
Target Version | 6.9.1 | Fixed in Version | 6.9.1 | ||
Summary | 0026230: Segmentation fault because a NULL curve is used without precaution in case of a projection failure | ||||
Description | Unfortunately my example file is confidential, but I try to describe it as detailed as possible. I call BOPTools_AlgoTools2D::CurveOnSurface(...) to get a Handle(Geom2d_Curve) for an edge on a face (but the edge is not a boundary edge of that face). Finally we come down to BOPTools_AlgoTools2D::MakePCurveOnFace. Here it is tried three times to compute the projection of the curve onto the surface (around line 610 of BOPTools_AlgoTools2D.cxx). The first two times, if the projection fails and the result curve is still NULL, the projection is tried again with a raised tolerance. But when the third projection fails, this is not handled anymore. The resulting curve is a NULL handle and therefore I get a segmentation fault here when the statement BOPTools_AlgoTools2D::AdjustPCurveOnFace (aF, aFirst, aLast, aC2D, aC2DA); (around line 621 of BOPTools_AlgoTools2D.cxx) is executed. I would expect another aC2D.IsNull() check at the end of BOPTools_AlgoTools2D::MakePCurveOnFace and an error should be raised in this case. | ||||
Steps To Reproduce | Not required | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
Branch CR26230 has been created by ifv. SHA-1: 5a07bb57f17ebfb987a9bcf4364920073101c282 Detailed log of new commits: Author: ifv Date: Thu May 21 16:29:18 2015 +0300 0026230: Segmentation fault because a NULL curve is used without precaution in case of a projection failure |
|
branch CR26230 is ready for review |
|
It is needed to check the pcurve for null not only in the methods of the class BOPTools_AlgoTools2D, but follow the caller of these methods everywhere in OCCT code and protect all found places. |
|
Wouldn't it be sufficient to raise an error, if projection is not possible? Then the callers can handle this as they want. At least for me this would suffice. |
|
After discussion, we came to conclusion that it is better to raise a C++ exception in the case of projection failure. |
|
Might it be possible then to include this improvement into a release earlier than 7.1.0? It would really be helpful! |
|
Mikhail, please reconsider your idea of raising exception: in most cases it is better to produce invalid shape (without pcurve), which still can be usable, than exception (which will never be usable and has big chance to cause serious troubles on the application level). Consider returning some result and error status if problem occurs. |
|
Andrey, this method was developed to be used in the context of Boolean operations. Failure of pcurve construction cannot lead to a usable result of Boolean. Exception will be caught on the upper level of the algorithm, and error status will be set. However, I think we should leave a corresponding warning in Doxygen documentation for all methods of this class (BOPTools), which will raise exception if projection is failure. |
|
Benjamin, if the fix will be already in master when 7.0.0 will be prepared then certainly this fix will hit in the release. |
|
Branch CR26230 has been updated forcibly by ifv. SHA-1: 4b1a5d90d077c6eb71df42f311d7af843fdd8827 |
|
Reviewed. |
|
Branch CR26230 has been updated forcibly by apv. SHA-1: 1d42e8fa44d0e06e5dac40ec2b9c4be7d584a962 |
|
Branch CR26230 has been rebased on the current master |
|
Dear BugMaster, Branch CR26230 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested. SHA-1: 1d42e8fa44d0e06e5dac40ec2b9c4be7d584a962 Number of compiler warnings: occt component: Linux: 25 (25 on master) Windows: 0 (0 on master) products component: Linux: 37 (37 on master) Windows: 0 (0 on master) Regressions/Differences: Not detected Testing cases: Not needed Testing on Linux: Total MEMORY difference: 96045957 / 96362479 [-0.33%] Total CPU difference: 18211.99999999994 / 18304.16000000009 [-0.50%] Testing on Windows: Total MEMORY difference: 56696505 / 57009585 [-0.55%] Total CPU difference: 17356.515258998883 / 17523.436328998818 [-0.95%] |
|
Branch CR26230 has been deleted by inv. SHA-1: 1d42e8fa44d0e06e5dac40ec2b9c4be7d584a962 |
occt: master b9a7d225 2015-05-29 08:25:56
Committer: bugmaster Details Diff |
0026230: Segmentation fault because a NULL curve is used without precaution in case of a projection failure |
Affected Issues 0026230 |
|
mod - src/BOPTools/BOPTools_AlgoTools2D.cdl | Diff File | ||
mod - src/BOPTools/BOPTools_AlgoTools2D.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-05-18 16:13 | BenjaminBihler | New Issue | |
2015-05-18 16:13 | BenjaminBihler | Assigned To | => msv |
2015-05-18 17:06 |
|
Assigned To | msv => ifv |
2015-05-18 17:08 |
|
Target Version | => 7.1.0 |
2015-05-21 16:53 | git | Note Added: 0041393 | |
2015-05-21 16:54 |
|
Note Added: 0041394 | |
2015-05-21 16:54 |
|
Assigned To | ifv => msv |
2015-05-21 16:54 |
|
Status | new => resolved |
2015-05-21 16:54 |
|
Steps to Reproduce Updated | |
2015-05-21 17:23 |
|
Note Added: 0041395 | |
2015-05-21 17:23 |
|
Status | resolved => assigned |
2015-05-21 17:23 |
|
Assigned To | msv => ifv |
2015-05-28 12:29 | BenjaminBihler | Note Added: 0041646 | |
2015-05-28 12:38 |
|
Note Added: 0041647 | |
2015-05-28 12:57 | BenjaminBihler | Note Added: 0041651 | |
2015-05-28 14:39 |
|
Note Added: 0041664 | |
2015-05-28 15:17 |
|
Note Added: 0041671 | |
2015-05-28 15:21 |
|
Note Added: 0041673 | |
2015-05-29 13:55 | git | Note Added: 0041720 | |
2015-05-29 13:56 |
|
Assigned To | ifv => msv |
2015-05-29 13:56 |
|
Status | assigned => resolved |
2015-05-29 16:30 |
|
Note Added: 0041750 | |
2015-05-29 16:30 |
|
Assigned To | msv => bugmaster |
2015-05-29 16:30 |
|
Status | resolved => reviewed |
2015-05-29 16:31 |
|
Assigned To | bugmaster => apv |
2015-05-29 17:08 | git | Note Added: 0041756 | |
2015-05-29 17:09 |
|
Note Added: 0041757 | |
2015-06-01 17:52 |
|
Test case number | => Not needed |
2015-06-01 18:24 |
|
Note Added: 0041811 | |
2015-06-01 18:24 |
|
Assigned To | apv => bugmaster |
2015-06-01 18:24 |
|
Status | reviewed => tested |
2015-06-05 15:00 | bugmaster | Changeset attached | => occt master b9a7d225 |
2015-06-05 15:00 | bugmaster | Status | tested => verified |
2015-06-05 15:00 | bugmaster | Resolution | open => fixed |
2015-06-08 12:32 | bugmaster | Target Version | 7.1.0 => 7.0.0 |
2015-08-14 10:59 | git | Note Added: 0044251 | |
2015-08-26 11:11 |
|
Target Version | 7.0.0 => 6.9.1 |
2015-10-16 14:56 |
|
Status | verified => closed |
2015-10-23 20:51 |
|
Fixed in Version | => 6.9.1 |