View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027070 | Community | OCCT:Data Exchange | public | 2016-01-10 20:42 | 2018-06-29 21:21 |
Reporter | Epy | Assigned To | bugmaster | ||
Priority | normal | Severity | crash | ||
Status | closed | Resolution | fixed | ||
Platform | x86-64 | OS | Lubuntu | ||
Product Version | 6.8.0 | ||||
Target Version | 7.3.0 | Fixed in Version | 7.3.0 | ||
Summary | 0027070: Data Exchange - Segfault when transferring HLR-created shapes via STEPControl_Writer | ||||
Description | I created the following small program to explore the outlines and hidden lines created by HLR. The program segfaults on all of the commented lines. I used the program with another STEP file which was also created by OCCT libraries. #include <STEPControl_Reader.hxx> #include <TopoDS_Shape.hxx> #include <HLRBRep_Algo.hxx> #include <gp_Ax2.hxx> #include <gp_Dir.hxx> #include <HLRAlgo_Projector.hxx> #include <HLRBRep_HLRToShape.hxx> #include <STEPControl_Writer.hxx> int main(int argc, char **argv) { if (argc < 2) return 1; STEPControl_Reader scr; scr.ReadFile(argv[1]); scr.TransferRoots(); Handle(HLRBRep_Algo) hlr = new HLRBRep_Algo; hlr->Add(scr.OneShape()); gp_Ax2 a1(gp::Origin(), gp_Dir(0, 1, 0)); HLRAlgo_Projector proj(a1); hlr->Projector(proj); hlr->Update(); hlr->Hide(); HLRBRep_HLRToShape shapes(hlr); STEPControl_Writer scw; scw.Transfer(shapes.VCompound(), STEPControl_AsIs); // scw.Transfer(shapes.Rg1LineVCompound(), STEPControl_AsIs); // scw.Transfer(shapes.RgNLineVCompound(), STEPControl_AsIs); // scw.Transfer(shapes.OutLineVCompound(), STEPControl_AsIs); // scw.Transfer(shapes.IsoLineVCompound(), STEPControl_AsIs); scw.Transfer(shapes.HCompound(), STEPControl_AsIs); // scw.Transfer(shapes.Rg1LineHCompound(), STEPControl_AsIs); // scw.Transfer(shapes.RgNLineHCompound(), STEPControl_AsIs); // scw.Transfer(shapes.OutLineHCompound(), STEPControl_AsIs); // scw.Transfer(shapes.IsoLineHCompound(), STEPControl_AsIs); scw.Write("Ex7_HLRDump.stp"); return 0; } | ||||
Steps To Reproduce | pload XSDRAW dall stepwrite a a | ||||
Tags | No tags attached. | ||||
Test case number | bugs step bug27070 | ||||
|
Ex7_HLRDump.cxx (1,326 bytes) |
|
Ex1_ExtrudeAndCut.stp (22,551 bytes) |
|
The sample program is incorrect, as it does not check the shapes for null before passing them for transferring. |
|
Very well, but it seems strange that STEPControl_Writer::Transfer() does not check to see if the input shape is null first. |
|
Dear gka, what is your opinion? Do we need to implement protection against null shapes in Transfer method? |
|
Branch CR27070 has been created by abv. SHA-1: 9fe3015bc4741de506eb9ecb52696c0091f34ff4 Detailed log of new commits: Author: abv Date: Thu Mar 8 09:56:01 2018 +0300 0027070: Segfault when transferring HLR-created shapes via STEPControl_Writer Added protection against null shape on writing: status IFSelect_RetVoid will be returned in such case (instead of access violation) |
|
Fix (protection against null shape) is pushed to CR27070, please review |
|
The tests passed OK indeed, see Jenkins job CR27070-master-abv |
|
Combination - OCCT branch : CR27070 SHA - 9fe3015bc4741de506eb9ecb52696c0091f34ff4 Products branch : master SHA - 4fd289ec73d35d02f23f3990c73b3acac9a60574 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: Debian70-64: OCCT Total CPU difference: 18226.24999999965 / 18338.37999999957 [-0.61%] Products Total CPU difference: 7463.559999999991 / 7461.340000000009 [+0.03%] Windows-64-VC10: OCCT Total CPU difference: 17843.83118279852 / 17653.338361698563 [+1.08%] Products Total CPU difference: 8007.858932099991 / 7990.761222500007 [+0.21%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR27070 has been deleted by kgv. SHA-1: 9fe3015bc4741de506eb9ecb52696c0091f34ff4 |
occt: master 0a0eec80 2018-03-08 06:56:01
Committer: bugmaster Details Diff |
0027070: Segfault when transferring HLR-created shapes via STEPControl_Writer Added protection against null shape on writing: status IFSelect_RetVoid will be returned in such case (instead of access violation) |
Affected Issues 0027070 |
|
mod - src/XSControl/XSControl_WorkSession.cxx | Diff File | ||
add - tests/bugs/step/bug27070 | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-01-10 20:42 | Epy | New Issue | |
2016-01-10 20:42 | Epy | Assigned To | => msv |
2016-01-10 20:42 | Epy | File Added: Ex7_HLRDump.cxx | |
2016-01-10 20:42 | Epy | File Added: Ex1_ExtrudeAndCut.stp | |
2016-01-11 00:43 |
|
Note Added: 0049764 | |
2016-01-11 00:43 |
|
Assigned To | msv => Epy |
2016-01-11 00:43 |
|
Status | new => feedback |
2016-01-11 00:43 |
|
Resolution | open => no change required |
2016-01-11 01:02 | Epy | Note Added: 0049765 | |
2016-01-11 10:03 |
|
Note Added: 0049766 | |
2016-01-11 10:03 |
|
Assigned To | Epy => gka |
2016-01-11 10:04 |
|
Category | OCCT:Modeling Algorithms => OCCT:Data Exchange |
2017-08-14 16:16 |
|
Target Version | => 7.3.0 |
2018-03-08 09:56 | git | Note Added: 0074365 | |
2018-03-08 09:58 |
|
Note Added: 0074366 | |
2018-03-08 09:58 |
|
Status | feedback => resolved |
2018-03-08 09:58 |
|
Steps to Reproduce Updated | |
2018-03-08 13:58 | kgv | Summary | Segfault when transferring HLR-created shapes via STEPControl_Writer => Data Exchange - Segfault when transferring HLR-created shapes via STEPControl_Writer |
2018-03-09 12:13 |
|
Resolution | no change required => fixed |
2018-03-14 10:19 |
|
Note Added: 0074460 | |
2018-03-14 15:07 |
|
Assigned To | gka => bugmaster |
2018-03-14 15:07 |
|
Status | resolved => reviewed |
2018-03-14 16:19 | bugmaster | Test case number | => bugs step bug27070 |
2018-03-14 16:23 | bugmaster | Note Added: 0074480 | |
2018-03-14 16:23 | bugmaster | Status | reviewed => tested |
2018-03-18 13:21 | bugmaster | Changeset attached | => occt master 0a0eec80 |
2018-03-18 13:21 | bugmaster | Status | tested => verified |
2018-03-19 10:05 | git | Note Added: 0074591 | |
2018-06-29 21:16 |
|
Fixed in Version | => 7.3.0 |
2018-06-29 21:21 |
|
Status | verified => closed |