Archived issue #0030140
Modeling Algorithms - Access Null Pointer within FindPlane() defined in GeomFill_CorrectedFrenet.cxx
Description
In TKGeomAlgo/GeomFill/GeomFill_CorrectedFrenet.cxx,in Function FindPlane at line 267 to 278,the Value TabP not Allocate,so crash
default:
{ // On utilise un echantillonage
Standard_Integer nbp = 15 + theC->NbIntervals(GeomAbs_C3);
Standard_Real f, l, t, inv;
Standard_Integer ii;
f = theC->FirstParameter();
l = theC->LastParameter();
inv = 1./(nbp-1);
for (ii=1; ii<=nbp; ii++) {
t = ( f*(nbp-ii) + l*(ii-1));
t *= inv;
TabP->SetValue(ii, theC->Value(t));
}
}
}
so miss code like this TabP = new (TColgp_HArray1OfPnt) (1, nbp)?
default:
{ // On utilise un echantillonage
Standard_Integer nbp = 15 + theC->NbIntervals(GeomAbs_C3);
Standard_Real f, l, t, inv;
Standard_Integer ii;
f = theC->FirstParameter();
l = theC->LastParameter();
inv = 1./(nbp-1);
for (ii=1; ii<=nbp; ii++) {
t = ( f*(nbp-ii) + l*(ii-1));
t *= inv;
TabP->SetValue(ii, theC->Value(t));
}
}
}
so miss code like this TabP = new (TColgp_HArray1OfPnt) (1, nbp)?
Steps to reproduce
line l_path 0 0 0 1 0 0
trim l_path l_path 0 10
mkedge path l_path
wire path path
circle c_profile 0 0 2 1 0 0 5
mkedge profile c_profile
wire profile profile
pipe result path profile 0
# pipe on linear path is OK
point dir 0 1 0
offsetcurve offset_path l_path 2 dir
mkedge path offset_path
wire path path
pipe result path profile 0
# pipe on offset path raises exception
An exception was caught [revision removed] : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at address 0x0000000000000020 during 'READ' operation
** Exception ** [revision removed] : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at address 0x0000000000000020 during 'READ' operation
trim l_path l_path 0 10
mkedge path l_path
wire path path
circle c_profile 0 0 2 1 0 0 5
mkedge profile c_profile
wire profile profile
pipe result path profile 0
# pipe on linear path is OK
point dir 0 1 0
offsetcurve offset_path l_path 2 dir
mkedge path offset_path
wire path path
pipe result path profile 0
# pipe on offset path raises exception
An exception was caught [revision removed] : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at address 0x0000000000000020 during 'READ' operation
** Exception ** [revision removed] : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at address 0x0000000000000020 during 'READ' operation
Public activity
7 archived notes
Participants are labeled by their role within this record.
It is obvious that allocation is missing here.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: nbv
Date: Tue Sep 18 11:10:19 2018 +0300
0030140: Modeling Algorithms - Access Null Pointer
The array TabP has been allocated correctly.
[revision removed]
Detailed log of new commits:
Author: nbv
Date: Tue Sep 18 11:10:19 2018 +0300
0030140: Modeling Algorithms - Access Null Pointer
The array TabP has been allocated correctly.
Dear Eugeny,
Please review the branch CR30140.
Test results are here: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30140-master_NBV/
Please review the branch CR30140.
Test results are here: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30140-master_NBV/
Reviewed.
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
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: 17736.509999999784 / 17379.439999999933 [+2.05%]
Products
Total CPU difference: 7481.980000000051 / 7467.690000000077 [+0.19%]
Windows-64-VC14:
OCCT
Total CPU difference: 17561.42257249863 / 17536.33761169853 [+0.14%]
Products
Total CPU difference: 8368.408443299986 / 8382.276932199968 [-0.17%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
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: 17736.509999999784 / 17379.439999999933 [+2.05%]
Products
Total CPU difference: 7481.980000000051 / 7467.690000000077 [+0.19%]
Windows-64-VC14:
OCCT
Total CPU difference: 17561.42257249863 / 17536.33761169853 [+0.14%]
Products
Total CPU difference: 8368.408443299986 / 8382.276932199968 [-0.17%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: nbv
Date: Wed Sep 19 10:00:47 2018 +0300
# Small correction in the test case
[revision removed]
Detailed log of new commits:
Author: nbv
Date: Wed Sep 19 10:00:47 2018 +0300
# Small correction in the test case
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records