View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023284 | Community | OCCT:Foundation Classes | public | 2012-07-16 13:24 | 2013-04-29 15:23 |
Reporter | Pawel | Assigned To | |||
Priority | normal | Severity | crash | ||
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | VC++ 2008 | ||
Product Version | 6.5.3 | ||||
Target Version | 6.6.0 | Fixed in Version | 6.6.0 | ||
Summary | 0023284: Using 'memcpy' on class that contains a virtual method | ||||
Description | The 'memcpy' function is used to copy the fields of 'MemBlock' class. Virtual method table will be damaged by this. Warning issued by PVS-Studio in NCollection_Vector.cxx, line 296: memcpy (aData, aSource, aSize * sizeof(MemBlock)); This might lead to a crash but I haven't tested it. | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
related to | 0023267 | closed | cppcheck warning: Using 'memcpy' on class that contains a virtual method |
|
Dear kgv, I've implemented a fix into branch CR23284. Please, review. |
|
Patch was reviewed without remarks. Ready for testing in CR23284_1 branch. |
|
Dear BugMaster, Branch CR23284_1 was rebased on the current master. Branch CR23284_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested. SHA-1: 3ad74093025719d0110ba6ea20838240cdccd35d There are following compilation errors: http://jenkins-test-01.nnov.opencascade.com/user/mnt/my-views/view/CR23284_1/job/mnt-CR23284_1-master_build_occt_products_linux/1/parsed_console/? ../../../inc/QMData_BgrNode.hxx:120: error: 'QMData_BgrNode::QMData_BgrNode(const QMData_BgrNode&)' is protected dn60/WOKLOC/wok_entities/LOC/dev/CR23284-1-master-occt/inc/NCollection_Vector.hxx:92: error: within this context Number of compiler warnings: occt component : Linux: 3 (3 on master) Windows: 39 (39 on master) Regressions: http://occt-tests/CR23284-1-master-occt/Mandriva2010/summary.html bugs step(007) bug55 bug272_5 bug16351 Improvements: No improvements Testing cases: Not needed |
|
Dear SZV, I've implemented a fix into branch CR23284_2. Please, review. |
|
Dear omy, could you please consider conversion of NCollection_BaseVector::MemBlock class to POD structure (remove myAlloc field, destructor and custom constructors)? I don't see any usage of NCollection_Vector::~MemBlock in code at all since elements destroyed by NCollection_Vector::Reinit and allocated only within NCollection_Vector::FuncDataInit. Also this is preferred to rebase your patch before sending it to review since NCollection_Vector sources are out-dated in your branch. |
|
Dear kgv, I've implemented a fix into branch CR23284_2 and rebased it onto current master. Please, review. |
|
Patch is ready for testing in CR23284_3 branch. |
|
Dear BugMaster, Branch CR23284_3 (and products from GIT master) was compiled on Linux and Windows platforms. There are following compilation errors: http://jenkins-test-01.nnov.opencascade.com:8080/user/mnt/my-views/view/CR23284_3/job/mnt-CR23284_3-master_build_occt_linux/1/consoleFull /bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../inc -I../../../drv/math -I../../../src/math -I../../../drv/ElCLib -I../../../src/ElCLib -I../../../drv/ElSLib -I../../../src/ElSLib -I../../../drv/BSplCLib -I../../../src/BSplCLib -I../../../drv/BSplSLib -I../../../src/BSplSLib -I../../../drv/PLib -I../../../src/PLib -I../../../drv/Precision -I../../../src/Precision -I../../../drv/GeomAbs -I../../../src/GeomAbs -I../../../drv/Poly -I../../../src/Poly -I../../../drv/CSLib -I../../../src/CSLib -I../../../drv/Convert -I../../../src/Convert -I../../../drv/Bnd -I../../../src/Bnd -I../../../drv/gp -I../../../src/gp -I../../../drv/TColgp -I../../../src/TColgp -I../../../drv/TopLoc -I../../../src/TopLoc -I/dn48/PRODUCTS/salome/6.x/opt/MANDRIVA.2010/6.6.0/jdk1.6.0/include -I/dn48/PRODUCTS/salome/6.x/opt/MANDRIVA.2010/6.6.0/jdk1.6.0/include/linux -DNDEBUG -DNo_Exception -DCSFDB -DOCC_CONVERT_SIGNALS -DLIN -DLININTEL -D_GNU_SOURCE=1 -O2 -MT Poly_MakeLoops.lo -MD -MP -MF .deps/Poly_MakeLoops.Tpo -c -o Poly_MakeLoops.lo `test -f '../../../src/Poly/Poly_MakeLoops.cxx' || echo './'`../../../src/Poly/Poly_MakeLoops.cxx In file included from ../../../inc/Poly_CoherentTriangulation.hxx:29, from ../../../src/Poly/Poly_CoherentTriangulation.cxx:21: ../../../inc/NCollection_Vector.hxx: In constructor 'NCollection_Vector<TheItemType>::NCollection_Vector(Standard_Integer, const Handle_NCollection_BaseAllocator&)': ../../../inc/NCollection_Vector.hxx:117: error: 'myAllocator' was not declared in this scope ../../../inc/NCollection_Vector.hxx: In copy constructor 'NCollection_Vector<TheItemType>::NCollection_Vector(const NCollection_Vector<TheItemType>&)': ../../../inc/NCollection_Vector.hxx:122: error: 'myAllocator' was not declared in this scope ../../../inc/NCollection_Vector.hxx: In destructor 'NCollection_Vector<TheItemType>::~NCollection_Vector()': ../../../inc/NCollection_Vector.hxx:134: error: 'myAllocator' was not declared in this scope ../../../inc/NCollection_Vector.hxx: In member function 'TheItemType& NCollection_Vector<TheItemType>::Append(const TheItemType&)': ../../../inc/NCollection_Vector.hxx:203: error: 'myAllocator' was not declared in this scope ../../../inc/NCollection_Vector.hxx: In member function 'TheItemType& NCollection_Vector<TheItemType>::SetValue(Standard_Integer, const TheItemType&)': ../../../inc/NCollection_Vector.hxx:259: error: 'myAllocator' was not declared in this scope ../../../inc/NCollection_Vector.hxx: In member function 'void NCollection_Vector<TheItemType>::Assign(const NCollection_Vector<TheItemType>&, Standard_Boolean)': ../../../inc/NCollection_Vector.hxx:343: error: 'myAllocator' was not declared in this scope |
|
Dear kgv, I've fixed the mentioned compilation errors. Please, review. |
|
No remarks, please test. |
|
Dear BugMaster, Branch CR23284_3 (and products from GIT master) was compiled on Linux and Windows platforms and tested without rebase. SHA-1: 9f7ef1d5cabd8756912221bb68444ac7fb473e69 Number of compiler warnings: occt component : Linux: 3 (3 on master) Windows: 11 (11 on master) products component : Linux: 0 (0 on master) Windows: 50 (50 on master) Regressions: No regressions Improvements: No improvements Testing cases: Not needed Testing on Linux: Total MEMORY difference: 242475480 / 243421460 Total CPU difference: 17395.4600000001 / 15475.660000000038 Testing on Windows: Total MEMORY difference: 345678912 / 346233352 Total CPU difference: 17723.0625 / 21620.5 There are not serious differences in images found by testdiff. |
occt: master f4aad56f 2013-03-15 09:04:26
|
0023284: Using 'memcpy' on class that contains a virtual method NCollection_BaseVector::MemBlock class was converted to POD structure Added fix for compilation of multiple inherited classes on gcc/Linux |
Affected Issues 0023284 |
|
mod - src/NCollection/NCollection_BaseVector.cxx | Diff File | ||
mod - src/NCollection/NCollection_BaseVector.hxx | Diff File | ||
mod - src/NCollection/NCollection_Vector.hxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-07-16 13:24 | Pawel | New Issue | |
2012-07-16 13:24 | Pawel | Assigned To | => bugmaster |
2012-07-16 13:25 | Pawel | Relationship added | related to 0023267 |
2012-10-11 13:27 | oan | Assigned To | bugmaster => isn |
2012-10-11 13:28 | oan | Status | new => assigned |
2012-10-23 18:16 |
|
Target Version | 6.5.4 => 6.6.0 |
2012-10-26 17:53 |
|
Assigned To | isn => omy |
2013-02-01 14:41 |
|
Note Added: 0023234 | |
2013-02-01 14:41 |
|
Assigned To | omy => kgv |
2013-02-01 14:41 |
|
Status | assigned => resolved |
2013-02-04 11:57 | kgv | Note Added: 0023248 | |
2013-02-04 11:57 | kgv | Assigned To | kgv => bugmaster |
2013-02-04 11:57 | kgv | Status | resolved => reviewed |
2013-02-05 12:50 |
|
Note Added: 0023260 | |
2013-02-05 12:50 |
|
Test case number | => Not needed |
2013-02-05 12:50 |
|
Assigned To | bugmaster => omy |
2013-02-05 12:50 |
|
Status | reviewed => assigned |
2013-02-13 14:49 |
|
Note Added: 0023319 | |
2013-02-13 14:49 |
|
Assigned To | omy => szv |
2013-02-13 14:49 |
|
Status | assigned => resolved |
2013-02-13 22:28 | kgv | Note Added: 0023330 | |
2013-02-13 22:28 | kgv | Assigned To | szv => omy |
2013-02-13 22:28 | kgv | Status | resolved => assigned |
2013-02-14 17:19 |
|
Note Added: 0023341 | |
2013-02-14 17:19 |
|
Assigned To | omy => kgv |
2013-02-14 17:19 |
|
Status | assigned => resolved |
2013-03-07 17:37 | kgv | Note Added: 0023630 | |
2013-03-07 17:37 | kgv | Assigned To | kgv => bugmaster |
2013-03-07 17:37 | kgv | Status | resolved => reviewed |
2013-03-07 17:45 |
|
Assigned To | bugmaster => mkv |
2013-03-12 12:23 |
|
Note Added: 0023663 | |
2013-03-12 12:23 |
|
Assigned To | mkv => omy |
2013-03-12 12:23 |
|
Status | reviewed => assigned |
2013-03-13 09:54 |
|
Note Added: 0023690 | |
2013-03-13 09:54 |
|
Assigned To | omy => kgv |
2013-03-13 09:54 |
|
Status | assigned => resolved |
2013-03-13 09:59 | kgv | Note Added: 0023691 | |
2013-03-13 09:59 | kgv | Assigned To | kgv => bugmaster |
2013-03-13 09:59 | kgv | Status | resolved => reviewed |
2013-03-13 13:31 |
|
Assigned To | bugmaster => mkv |
2013-03-15 14:15 |
|
Note Added: 0023748 | |
2013-03-15 14:18 |
|
Note Edited: 0023748 | |
2013-03-15 14:18 |
|
Assigned To | mkv => bugmaster |
2013-03-15 14:18 |
|
Status | reviewed => tested |
2013-03-18 20:48 |
|
Changeset attached | => occt master f4aad56f |
2013-03-18 20:48 |
|
Assigned To | bugmaster => omy |
2013-03-18 20:48 |
|
Status | tested => verified |
2013-03-18 20:48 |
|
Resolution | open => fixed |
2013-04-23 13:35 |
|
Status | verified => closed |
2013-04-29 15:23 |
|
Fixed in Version | => 6.6.0 |