View Issue Details

IDProjectCategoryView StatusLast Update
0023889CommunityOCCT:Visualizationpublic2013-12-19 13:55
ReporterPawel Assigned Tovro  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2008 
Product Version6.6.0 
Target Version6.7.0Fixed in Version6.7.0 
Summary0023889: Assignment of function parameter has no effect outside the function.
DescriptionIn Voxel_ROctBoolDS.cxx, in line 91:

data = 0;


The method:

static void SetZeroSplitData(Voxel_SplitData* data)

would have to take - Voxel_SplitData** data - as parameter in order to nullify the pointer. I'm not sure if this is necessary/intended.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0023899 closedPawel Crash in Voxel_ROctBoolDS::SetZero 

Activities

vro

2013-04-10 08:59

developer   ~0024063

Many thanks for the found bug! Indeed, the code is not quite correct. In spite of the method deletes the underlying data, assignment of the data to 0 has no effect outside of the method, as you noticed. So, in order to make as less changes as possible I added an ampersand:

static void SetZeroSplitData(Voxel_SplitData*& data)

Do you agree, Pawel? Let me know please if you see a better idea. Any remarks are welcome! :-)

vro

2013-04-10 09:00

developer   ~0024064

As usual, I forgot to say that the changes are in CR23889.

Pawel

2013-04-10 12:32

developer   ~0024072

Dear vro,

the patch looks good. cppcheck does not complain any more.

Thanks for correcting!

Unfortunately, I don't have any code using Voxel_ROctBoolDS at the moment. Currently, I have tested Voxel_BoolDS with Voxel_BooleanOperation and I can observe some problems (the results are not OK, visually) but haven't investigated that further.

However, I might post some new bugs concerning this issue;)

Pawel

2013-04-10 12:33

developer   ~0024073

No remarks, please test.

vro

2013-04-10 12:47

developer   ~0024074

Hello Pawel,
Any your remarks are welcome! Send them via this thread please as a feedback or somehow else as you prefer.
By the way, all Voxel functionality is called by means of a set of draw-commands starting with "voxel*". In particular, the Voxel_ROctBoolDS class is called from voxelroctboolds draw-command (see ViewerTest::VoxelCommands.cxx if you are interested in).
Have a good day,
Vro.

Pawel

2013-04-12 13:04

developer   ~0024107

A crash occurs in SetZeroSplitData when ~Voxel_ROctBoolDS() is called.

There is something wrong here. I'll try to investigate.

Pawel

2013-04-12 15:05

developer   ~0024118

I guess the afore mentioned crash is caused by something else so I propose to test.

apn

2013-04-15 14:47

administrator   ~0024134

There are compile errors on Linux platform (on WNT everything is ok):

../../../src/Voxel/Voxel_ROctBoolDS.cxx: In member function 'void Voxel_ROctBoolDS::SetZero()':
../../../src/Voxel/Voxel_ROctBoolDS.cxx:103: error: invalid initialization of non-const reference of type 'Voxel_SplitData*&' from a temporary of type 'Voxel_SplitData*'
../../../src/Voxel/Voxel_ROctBoolDS.cxx:81: error: in passing argument 1 of 'void SetZeroSplitData(Voxel_SplitData*&)'

vro

2013-05-08 14:53

developer   ~0024341

Dear Apn,
Could you please try to recompile the Voxel package again on Linux? I redesigned it so that it should compile on any platform, I think so.
The branch is CR23889 (same).
Thanks in advance,
Vro

apn

2013-06-06 18:05

administrator   ~0024676

There is compile error on Linux platform again.

../../../../src/Voxel/Voxel_ROctBoolDS.cxx: In member function ‘void Voxel_ROctBoolDS::SetZero()’:
../../../../src/Voxel/Voxel_ROctBoolDS.cxx:103: error: lvalue required as left operand of assignment

apn

2013-06-11 16:23

administrator   ~0024731

Compile error was fixed in branch CR23889

apn

2013-06-13 11:55

administrator   ~0024742

Last edited: 2013-06-13 11:55

Dear BugMaster,

Branch CR23889 (and products from GIT master) was compiled on Linux and Windows platforms and tested with rebase.
SHA-1: 29e7cf28a254532b91caccdfe680747a8ffbb944

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 7 (7 on master)

products component :
Linux: 0 (0 on master)
Windows: 63 (63 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 366393304 / 366250700
Total CPU difference: 39438.02000000052 / 43687.11000000146

Testing on Windows:
Total MEMORY difference: 421861908 / 423428180
Total CPU difference: 37359.6875 / 31296.5

There are not serious differences in images found by testdiff.

Related Changesets

occt: master 799e4491

2013-06-13 11:38:17

vro

Details Diff
0023889: Assignment of function parameter has no effect outside the function.

Voxel_ROctBoolDS::SetZeroSplitData() is modified to accept an address of a pointer to deleting data.
Removal of a compilation error on Linux.
Compile error on Linux platform was fixed
Affected Issues
0023889
mod - src/Voxel/Voxel_ROctBoolDS.cxx Diff File

Issue History

Date Modified Username Field Change
2013-04-09 17:30 Pawel New Issue
2013-04-09 17:30 Pawel Assigned To => bugmaster
2013-04-09 17:38 abv Assigned To bugmaster => vro
2013-04-09 17:38 abv Status new => assigned
2013-04-10 08:59 vro Note Added: 0024063
2013-04-10 08:59 vro Assigned To vro => Pawel
2013-04-10 08:59 vro Status assigned => resolved
2013-04-10 09:00 vro Note Added: 0024064
2013-04-10 12:32 Pawel Note Added: 0024072
2013-04-10 12:32 Pawel Assigned To Pawel => bugmaster
2013-04-10 12:33 Pawel Note Added: 0024073
2013-04-10 12:47 vro Note Added: 0024074
2013-04-10 13:25 abv Status resolved => reviewed
2013-04-12 13:04 Pawel Note Added: 0024107
2013-04-12 13:04 Pawel Assigned To bugmaster => Pawel
2013-04-12 13:04 Pawel Status reviewed => assigned
2013-04-12 15:03 Pawel Status assigned => resolved
2013-04-12 15:05 Pawel Note Added: 0024118
2013-04-12 15:05 Pawel Assigned To Pawel => bugmaster
2013-04-12 15:05 Pawel Status resolved => reviewed
2013-04-12 15:30 Pawel Relationship added related to 0023899
2013-04-12 15:42 apn Assigned To bugmaster => apn
2013-04-15 14:47 apn Note Added: 0024134
2013-04-15 14:49 apn Test case number => Not needed
2013-04-15 14:49 apn Assigned To apn => vro
2013-04-15 14:49 apn Status reviewed => assigned
2013-05-08 14:53 vro Note Added: 0024341
2013-06-06 11:01 vro Assigned To vro => apn
2013-06-06 18:05 apn Note Added: 0024676
2013-06-06 18:06 apn Assigned To apn => vro
2013-06-11 16:23 apn Note Added: 0024731
2013-06-11 16:23 apn Status assigned => resolved
2013-06-13 10:49 vro Status resolved => reviewed
2013-06-13 11:55 apn Note Added: 0024742
2013-06-13 11:55 apn Note Edited: 0024742
2013-06-13 11:56 apn Assigned To vro => bugmaster
2013-06-13 11:56 apn Status reviewed => tested
2013-06-14 12:18 vro Changeset attached => occt master 799e4491
2013-06-14 12:18 vro Assigned To bugmaster => vro
2013-06-14 12:18 vro Status tested => verified
2013-06-14 12:18 vro Resolution open => fixed
2013-12-19 13:53 bugmaster Status verified => closed
2013-12-19 13:55 bugmaster Fixed in Version => 6.7.0