MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030565Community[OCCT] OCCT:Codingpublic2019-03-13 04:442019-03-13 07:43
Reportergalbramc 
Assigned Tokgv 
PrioritynormalSeveritycrash 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target VersionFixed in Version 
Summary0030565: Coding - Approx_SweepApproximation call on null pointer
DescriptionI compiled OCCT with the -fsanitize=undefined flag and got the following errors:

src/Approx/Approx_SweepApproximation.cxx:179:31: runtime error: member call on null pointer of type 'struct TColgp_HArray1OfVec2d'
src/Approx/Approx_SweepApproximation.cxx:179:31: runtime error: member access within null pointer of type 'struct TColgp_HArray1OfVec2d'

This is a problem when Num2DSS==0 the arrays:

 if (Num2DSS>0) {
   myPoles2d = new (TColgp_HArray1OfPnt2d)(1, Num2DSS);
   myDPoles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
   myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
   COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
 }

which are then used on line 179. This fix avoids the null pointer:

 myPoles2d = new (TColgp_HArray1OfPnt2d)(1, std::max(Num2DSS,1));
 myDPoles2d = new (TColgp_HArray1OfVec2d)(1, std::max(Num2DSS,1));
 myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, std::max(Num2DSS,1));
 COnSurfErr = new (TColStd_HArray1OfReal)(1, std::max(Num2DSS,1));

but may not be the right solution.
Steps To ReproduceCompile OCCT with a g++ newer than 4.9 with the -fsanitize=undefined compiler flag and run the test suite.
TagsNo tags attached.
Test case number
Attached Files

- Relationships
child of 0030557newkgv Open CASCADE Coding - eliminate errors reported by -fsanitize 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-03-13 04:44 galbramc New Issue
2019-03-13 04:44 galbramc Assigned To => kgv
2019-03-13 07:43 kgv Relationship added child of 0030557


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker