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-26 11:13
Reportergalbramc 
Assigned Tobugmaster 
PrioritynormalSeveritycrash 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target Version[OCCT] 7.4.0*Fixed 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 numberNot needed
Attached Files

- Relationships
related to 0030582verifiedapn Open CASCADE Coding - avoid defining references to properties of NULL objects 
child of 0030557newkgv Open CASCADE Coding - eliminate errors reported by -fsanitize 

-  Notes
(0083224)
kgv (developer)
2019-03-25 14:22

Should be fixed by 0030582.
Please check, if possible.
(0083226)
galbramc (reporter)
2019-03-25 20:23

This will be tricky for me to check as there are a large number of changes. I could try to put together an example for you if you would like?
(0083227)
galbramc (reporter)
2019-03-26 05:06

As best as I can tell it looks like the fix in 0030582 should resolve this problem.
(0083228)
kgv (developer)
2019-03-26 08:35

Dear bugmaster,

please switch this bug to VERIFIED (fixed in scope of 0030582).

- 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
2019-03-25 14:21 kgv Relationship added related to 0030582
2019-03-25 14:22 kgv Note Added: 0083224
2019-03-25 14:22 kgv Assigned To kgv => galbramc
2019-03-25 14:22 kgv Status new => feedback
2019-03-25 14:22 kgv Target Version => 7.4.0*
2019-03-25 20:23 galbramc Note Added: 0083226
2019-03-26 05:06 galbramc Note Added: 0083227
2019-03-26 08:35 kgv Note Added: 0083228
2019-03-26 08:35 kgv Assigned To galbramc => bugmaster
2019-03-26 11:13 apn Test case number => Not needed
2019-03-26 11:13 apn Status feedback => verified
2019-03-26 11:13 apn Resolution open => fixed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker