MantisBT - Community
View Issue Details
0023284Community[OCCT] OCCT:Foundation Classespublic2012-07-16 13:242013-04-29 15:23
Pawel 
omy 
normalcrash 
closedfixed 
WindowsVC++ 200832 bit
[OCCT] 6.5.3 
[OCCT] 6.6.0[OCCT] 6.6.0 
Not needed
0023284: Using 'memcpy' on class that contains a virtual method
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.
No tags attached.
related to 0023267closed omy cppcheck warning: Using 'memcpy' on class that contains a virtual method 
Issue History
2012-07-16 13:24PawelNew Issue
2012-07-16 13:24PawelAssigned To => bugmaster
2012-07-16 13:25PawelRelationship addedrelated to 0023267
2012-10-11 13:27oanAssigned Tobugmaster => isn
2012-10-11 13:28oanStatusnew => assigned
2012-10-23 18:16abvTarget Version6.5.4 => 6.6.0
2012-10-26 17:53abvAssigned Toisn => omy
2013-02-01 14:41omyNote Added: 0023234
2013-02-01 14:41omyAssigned Toomy => kgv
2013-02-01 14:41omyStatusassigned => resolved
2013-02-04 11:57kgvNote Added: 0023248
2013-02-04 11:57kgvAssigned Tokgv => bugmaster
2013-02-04 11:57kgvStatusresolved => reviewed
2013-02-05 12:50mkvNote Added: 0023260
2013-02-05 12:50mkvTest case number => Not needed
2013-02-05 12:50mkvAssigned Tobugmaster => omy
2013-02-05 12:50mkvStatusreviewed => assigned
2013-02-13 14:49omyNote Added: 0023319
2013-02-13 14:49omyAssigned Toomy => szv
2013-02-13 14:49omyStatusassigned => resolved
2013-02-13 22:28kgvNote Added: 0023330
2013-02-13 22:28kgvAssigned Toszv => omy
2013-02-13 22:28kgvStatusresolved => assigned
2013-02-14 17:19omyNote Added: 0023341
2013-02-14 17:19omyAssigned Toomy => kgv
2013-02-14 17:19omyStatusassigned => resolved
2013-03-07 17:37kgvNote Added: 0023630
2013-03-07 17:37kgvAssigned Tokgv => bugmaster
2013-03-07 17:37kgvStatusresolved => reviewed
2013-03-07 17:45mkvAssigned Tobugmaster => mkv
2013-03-12 12:23mkvNote Added: 0023663
2013-03-12 12:23mkvAssigned Tomkv => omy
2013-03-12 12:23mkvStatusreviewed => assigned
2013-03-13 09:54omyNote Added: 0023690
2013-03-13 09:54omyAssigned Toomy => kgv
2013-03-13 09:54omyStatusassigned => resolved
2013-03-13 09:59kgvNote Added: 0023691
2013-03-13 09:59kgvAssigned Tokgv => bugmaster
2013-03-13 09:59kgvStatusresolved => reviewed
2013-03-13 13:31mkvAssigned Tobugmaster => mkv
2013-03-15 14:15mkvNote Added: 0023748
2013-03-15 14:18mkvNote Edited: 0023748bug_revision_view_page.php?bugnote_id=23748#r5186
2013-03-15 14:18mkvAssigned Tomkv => bugmaster
2013-03-15 14:18mkvStatusreviewed => tested
2013-03-18 20:48omyChangeset attached => occt master f4aad56f
2013-03-18 20:48omyAssigned Tobugmaster => omy
2013-03-18 20:48omyStatustested => verified
2013-03-18 20:48omyResolutionopen => fixed
2013-04-23 13:35aivStatusverified => closed
2013-04-29 15:23aivFixed in Version => 6.6.0

Notes
(0023234)
omy   
2013-02-01 14:41   
Dear kgv,
I've implemented a fix into branch CR23284.
Please, review.
(0023248)
kgv   
2013-02-04 11:57   
Patch was reviewed without remarks.
Ready for testing in CR23284_1 branch.
(0023260)
mkv   
2013-02-05 12:50   
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
(0023319)
omy   
2013-02-13 14:49   
Dear SZV,
I've implemented a fix into branch CR23284_2.
Please, review.
(0023330)
kgv   
2013-02-13 22:28   
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.
(0023341)
omy   
2013-02-14 17:19   
Dear kgv,
I've implemented a fix into branch CR23284_2 and rebased it onto current master.
Please, review.
(0023630)
kgv   
2013-03-07 17:37   
Patch is ready for testing in CR23284_3 branch.
(0023663)
mkv   
2013-03-12 12:23   
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
(0023690)
omy   
2013-03-13 09:54   
Dear kgv,
I've fixed the mentioned compilation errors.
Please, review.
(0023691)
kgv   
2013-03-13 09:59   
No remarks, please test.
(0023748)
mkv   
2013-03-15 14:15   
(edited on: 2013-03-15 14:18)
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.