MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027567Open CASCADE[OCCT] OCCT:VISpublic2016-06-02 22:122016-12-09 16:38
Reporterabv 
Assigned Tobugmaster 
PriorityhighSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.1.0Fixed in Version[OCCT] 7.1.0 
Summary0027567: VIS - possible memory leaks due to use of plain pointers
DescriptionAs suggested by fix for memory leak made in OCE, the fix for 0026625 is incomplete, and memory leaks still remain in IVtkVTK_ShapeData.cxx.

The reffered OCE commit is:
https://github.com/tpaviot/oce/commit/e6847828a024f5dfeb13ca72a13838e959790626 [^]

The problem is on line 41 in current OCCT master (c5c7af4b7):

> myPolyData->SetPoints (vtkPoints::New());

Here method New() returns object with reference counter = 1, which will never be destroyed.

Apparently the same problem exists in

- method IVtkTools_SubPolyDataFilter::RequestData(), variable anIdList
- IVtkTools_ShapeObject.cxx, lines 91 and 111

In some places pointer obtained by call to unguarded New() is returned from a function, e.g. IVtkTools::InitLookupTable(). When this function is used (e.g. in InitShapeMapper()), there is nothing that implies that the memory will be returned, thus I suspect that this also will lead to memory leaks.

The safe approach should be to always use smart pointers and never call unguarded New().
Steps To ReproduceFixed.
The new test has been added: v3d/ivtk/bug27567
TagsNo tags attached.
Test case numberbugs vis bug27567
Attached Files

- Relationships
related to 0027734closedbugmaster Community Configuration - TKIVtkDraw build fails with TBB 
child of 0026625closedbugmaster Community Possible wrong use of vtkSmartPointer<T> in IVtkVTK_ShapeData.cxx 

-  Notes
(0056974)
git (administrator)
2016-08-23 15:50

Branch CR27567 has been created by rkv.

SHA-1: 46f2d2914c3a85fea25e8a8b140fadfd5f1715cc


Detailed log of new commits:

Author: rkv
Date: Tue Aug 23 15:52:11 2016 +0300

    0027567: VIS - possible memory leaks due to use of plain pointers: Fixed according to http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers [^]
(0056979)
rkv (developer)
2016-08-23 16:14

Please note that it is necessary to fix guide also at https://www.opencascade.com/doc/occt-6.9.0/overview/html/occt_user_guides__vis.html [^]

The line
vtkLookupTable* Table = IVtkTools::InitLookupTable();

should be replaced by the following:
vtkSmartPointer<vtkLookupTable> Table = IVtkTools::InitLookupTable();
(0056985)
git (administrator)
2016-08-23 16:53

Branch CR27567 has been updated by rkv.

SHA-1: 76eaf7557fb339fba7d797f10c81ff8a20850780


Detailed log of new commits:

Author: rkv
Date: Tue Aug 23 16:55:05 2016 +0300

    0027567: VIS - possible memory leaks due to use of plain pointers: Fix the VIS guide.

(0057009)
san (developer)
2016-08-23 21:54

Please prepare a Git branch with a single combined commit.
(0057011)
git (administrator)
2016-08-24 08:37

Branch CR27567 has been updated by rkv.

SHA-1: afb707a1350362c5781a7f287214a4900186546c


Detailed log of new commits:

Author: rkv
Date: Wed Aug 24 08:38:56 2016 +0300

    Merge branch 'CR27567' of git.dev.opencascade.org:occt into CR27567

Author: rkv
Date: Tue Aug 23 15:52:11 2016 +0300

    0027567: VIS - possible memory leaks due to use of plain pointers: Fix the VIS guide.
    http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers [^]

(0057012)
git (administrator)
2016-08-24 08:48

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 3b2f972d65100cb3efd352f877ffc0f7a443fe01
(0057034)
git (administrator)
2016-08-24 16:09

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 8059b0eeb79607c1e4e275ce1088a4d87b5190a6
(0057036)
san (developer)
2016-08-24 16:32

Can you please create a test case that detects memory leaks after multiple more or less complete IVtk usage cycles (display a shape in VTK view, activate selection modes, select some entities, delete a shape and all its data from VTK)?

See test case bugs vis bug26538 as an example of memory leak detection.
(0057311)
git (administrator)
2016-08-30 20:54

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 32a76b05e1bd595e9ddd6b7c0159765c1fc59e6a
(0057313)
git (administrator)
2016-08-31 09:20

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 6de99bc31cd60a60b51435622a18497c62428859
(0057317)
kgv (developer)
2016-08-31 11:13

- Please correct commit so that author and committer will be the same.
- Please remove external URLs from the commit description.
(0057328)
git (administrator)
2016-08-31 13:12

Branch CR27567 has been updated forcibly by rkv.

SHA-1: fd4e3decabe7c3716031380cf4fd4fe0a02722aa
(0057377)
git (administrator)
2016-09-01 11:09

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 646b7d83f7648ae5ec144c796149204c21adfae4
(0057391)
san (developer)
2016-09-01 15:38

Branch CR27567 reviewed without remarks, ready for testing.
(0057396)
git (administrator)
2016-09-01 17:26

Branch CR27567 has been updated forcibly by mkv.

SHA-1: 4db99844eb5c6ed9b3ef6c60b99e6e92ab8681f0
(0057410)
mkv (tester)
2016-09-02 13:21

Dear BugMaster,
Branch CR27567 was rebased on IR-2016-09-01 of occt git-repository.
(0057411)
mkv (tester)
2016-09-02 13:22

Dear BugMaster,
Branch CR27567 from occt git-repository (and IR-2016-09-01 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 4db99844eb5c6ed9b3ef6c60b99e6e92ab8681f0

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1150

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27567-master-OCCT/Debian70-64/bugs/vis/bug27567.html [^]
http://occt-tests/CR27567-master-OCCT/Windows-64-VC10/bugs/vis/bug27567.html [^]
bugs vis bug27567: FAILED (exception)

Testing on Linux:
occt component :
Total MEMORY difference: 89312840 / 89476228 [-0.18%]
Total CPU difference: 19317.560000000005 / 19241.180000000015 [+0.40%]
products component :
Total MEMORY difference: 30011013 / 29985574 [+0.08%]
Total CPU difference: 5109.999999999963 / 5115.309999999973 [-0.10%]

Testing on Windows:
occt component :
Total MEMORY difference: 57147679 / 57155154 [-0.01%]
Total CPU difference: 18213.8031543988 / 18057.115749998855 [+0.87%]
products component :
Total MEMORY difference: 21260683 / 21225231 [+0.17%]
Total CPU difference: 4898.322199299956 / 4849.119483899957 [+1.01%]

There are no differences in images found by testdiff.
(0057412)
mkv (tester)
2016-09-02 13:22

Dear rkv,
Branch CR27567 has been rejected due to:
- failed test-case for issue


There are 2 variants of correction for test case bugs vis bug27567:
1 - add drow-command "pload VIS"
2 - move test case to v3d/ivtk test group
(0057417)
git (administrator)
2016-09-02 14:29

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 21424f60e5b1e1d3e05839ea33888f4d64601db7
(0057423)
san (developer)
2016-09-02 14:38

Branch CR27567 without remarks, ready for testing.
(0057429)
git (administrator)
2016-09-02 15:36

Branch CR27567 has been updated forcibly by mkv.

SHA-1: e6539de314bf67d52646e73a61a5a65bc25c470a
(0057486)
mkv (tester)
2016-09-05 19:32

Dear BugMaster,
test case was retested.

Testing cases:
http://occt-tests/CR27567-master-OCCT/Debian70-64/v3d/ivtk/bug27567.html [^]
v3d ivtk bug27567: FAILED
Tcl Exception: Memory leak detected

http://occt-tests/CR27567-master-OCCT/Windows-64-VC10/v3d/ivtk/bug27567.html [^]
v3d ivtk bug27567: OK
(0057487)
mkv (tester)
2016-09-05 19:33

Dear rkv,
Branch CR27567 has been rejected due to:
- failed test-case for issue
(0057521)
git (administrator)
2016-09-06 15:41

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 8307146a1b813f300b6037caa3b21c3076d420d6
(0057522)
san (developer)
2016-09-06 15:52
edited on: 2016-09-06 15:53

Branch CR27567 reviewed without remarks.

Please, check the results of the corrected test case v3d ivtk bug27567 under Linux only, complete re-testing not needed.

(0057527)
mkv (tester)
2016-09-06 17:11

Dear BugMaster,
test case was retested.

Testing cases:
http://occt-tests/CR27567-master-OCCT/Debian70-64/v3d/ivtk/bug27567.html [^] [^]
v3d ivtk bug27567: FAILED
Tcl Exception: Memory leak detected
(0057529)
san (developer)
2016-09-06 17:27

Memory leak of 118 kbyte per iteration is beyond the negligible limit.

Thus the following steps are proposed:
- Try to understand why other test cases involving "checktrend" do not fail under Linux - or better to say, what makes bug27567 test case fail while the other similar ones do not, of course if there is some "suspicious" difference in the test scripts.
- If the problem cannot be solved at the level of the test script, analyze the reasons for such noticeable memory leaks under Linux (similarly to the analysis completed for Windows).
(0057648)
git (administrator)
2016-09-09 16:45

Branch CR27567 has been updated forcibly by rkv.

SHA-1: b48f0508f8c2ea82e777e41b35f0d516504ad631
(0057707)
san (developer)
2016-09-12 19:30

Can you please finalize correction of this issue?
(0057778)
git (administrator)
2016-09-14 13:56

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 2470ca028ae7d1bf59ac6d5a649dbaac84977f22
(0057783)
git (administrator)
2016-09-14 14:34

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 84e111623151b1afc0ab1f7e3231d720785fb1c3
(0057792)
git (administrator)
2016-09-14 16:55

Branch CR27567 has been updated forcibly by rkv.

SHA-1: c9dc99aa1d22a6b401d1d5f429856fafa3f61df9
(0057793)
rkv (developer)
2016-09-14 16:59

The reason of memory increase on Linux is virtual windows mode used by testgrid and offscreen rendering in this mode. The related bug #0027871 is created.
(0057804)
git (administrator)
2016-09-14 19:32

Branch CR27567 has been updated forcibly by rkv.

SHA-1: 6ff26ef91dd74634a0ecb0ee4f4d617d27ca4b2f
(0057806)
san (developer)
2016-09-14 19:38

Branch CR27567 reviewed without remarks, ready for testing.

It includes also the patch for 0027734 - thus please test branch compilation with TBB enabled under Windows!
(0057823)
mkv (tester)
2016-09-15 15:20

Dear rkv,
could you please rebase branch CR27567 on IR-2016-09-15.
(0057830)
git (administrator)
2016-09-15 17:24

Branch CR27567 has been updated forcibly by rkv.

SHA-1: ea91fbb950851e4a7f190eb22067d4e936831d41
(0057920)
mkv (tester)
2016-09-19 13:55

Dear BugMaster,
Branch CR27567 from occt git-repository (and IR-2016-09-15 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: ea91fbb950851e4a7f190eb22067d4e936831d41

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1166

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27567-master-OCCT/Debian70-64/v3d/ivtk/bug27567.html [^]
http://occt-tests/CR27567-master-OCCT/Windows-64-VC10/v3d/ivtk/bug27567.html [^]
v3d ivtk bug27567: OK

Testing on Linux:
occt component :
Total MEMORY difference: 90268969 / 89797117 [+0.53%]
Total CPU difference: 19278.499999999996 / 19211.76999999994 [+0.35%]
products component :
Total MEMORY difference: 29989654 / 29998572 [-0.03%]
Total CPU difference: 5070.319999999974 / 5119.779999999977 [-0.97%]

Testing on Windows:
occt component :
Total MEMORY difference: 57204088 / 57211877 [-0.01%]
Total CPU difference: 18218.997987698815 / 18509.12864749872 [-1.57%]
products component :
Total MEMORY difference: 21267626 / 21232183 [+0.17%]
Total CPU difference: 4830.399363899943 / 4959.0221883999575 [-2.59%]

There are no differences in images found by testdiff.
(0057921)
git (administrator)
2016-09-19 13:55

Branch CR27567 has been updated by mkv.

SHA-1: 4d141a23091fc5c848ff78dd58aaf1c309dab5aa


Detailed log of new commits:

Author: mkv
Date: Mon Sep 19 13:55:17 2016 +0300

    Small correction of test case for issue CR27567

(0057922)
mkv (tester)
2016-09-19 13:56

Dear BugMaster,
Branch CR27567 is TESTED.
(0059495)
git (administrator)
2016-10-28 21:45

Branch CR27567 has been deleted by kgv.

SHA-1: 4d141a23091fc5c848ff78dd58aaf1c309dab5aa

- Related Changesets
occt: master a2f76b15
Timestamp: 2016-08-23 12:52:11
Author: rkv
Committer: bugmaster
Details ] Diff ]
0027567: VIS - possible memory leaks due to use of plain pointers: Fix also the VIS guide. Add the test v3d/ivtk/bug27567. Add a draw command "ivtkremove".
0027734: Configuration - TKIVtkDraw build fails with TBB: Remove unnecessary define statement (windows specific).

Small correction of test case for issue CR27567
mod - dox/user_guides/vis/vis.md Diff ] File ]
mod - src/Draw/Draw_Interpretor.cxx Diff ] File ]
mod - src/DrawResources/TestCommands.tcl Diff ] File ]
mod - src/IVtkDraw/IVtkDraw.cxx Diff ] File ]
mod - src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx Diff ] File ]
mod - src/IVtkDraw/IVtkDraw_Interactor.cxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_SelectableObject.cxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_SelectableObject.hxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_ShapeMesher.cxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_ShapePickerAlgo.cxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_ShapePickerAlgo.hxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_ViewerSelector.cxx Diff ] File ]
mod - src/IVtkOCC/IVtkOCC_ViewerSelector.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_DisplayModeFilter.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeDataSource.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeDataSource.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeObject.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeObject.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapePicker.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapePicker.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_SubPolyDataFilter.hxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_ShapeData.cxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_ShapeData.hxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_View.cxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_View.hxx Diff ] File ]
mod - tests/bugs/begin Diff ] File ]
add - tests/v3d/ivtk/bug27567 Diff ] File ]

- Issue History
Date Modified Username Field Change
2016-06-02 22:12 abv New Issue
2016-06-02 22:12 abv Assigned To => san
2016-06-02 22:12 abv Relationship added child of 0026625
2016-06-03 10:40 san Assigned To san => aba
2016-06-07 06:47 abv Status new => assigned
2016-06-07 06:47 abv Priority normal => high
2016-07-01 16:30 san Assigned To aba => san
2016-08-01 19:40 san Assigned To san => aba
2016-08-18 20:19 san Assigned To aba => rkv
2016-08-23 15:50 git Note Added: 0056974
2016-08-23 15:58 rkv Assigned To rkv => san
2016-08-23 15:58 rkv Status assigned => resolved
2016-08-23 15:58 rkv Steps to Reproduce Updated View Revisions
2016-08-23 16:14 rkv Note Added: 0056979
2016-08-23 16:53 git Note Added: 0056985
2016-08-23 21:54 san Note Added: 0057009
2016-08-23 21:54 san Assigned To san => rkv
2016-08-23 21:54 san Status resolved => assigned
2016-08-24 08:37 git Note Added: 0057011
2016-08-24 08:48 git Note Added: 0057012
2016-08-24 08:57 rkv Assigned To rkv => san
2016-08-24 08:57 rkv Status assigned => resolved
2016-08-24 08:57 rkv Steps to Reproduce Updated View Revisions
2016-08-24 10:57 san Assigned To san => rkv
2016-08-24 10:57 san Status resolved => assigned
2016-08-24 16:09 git Note Added: 0057034
2016-08-24 16:10 rkv Assigned To rkv => san
2016-08-24 16:10 rkv Status assigned => resolved
2016-08-24 16:10 rkv Steps to Reproduce Updated View Revisions
2016-08-24 16:32 san Note Added: 0057036
2016-08-24 16:32 san Assigned To san => rkv
2016-08-24 16:32 san Status resolved => assigned
2016-08-30 20:54 git Note Added: 0057311
2016-08-30 20:58 rkv Assigned To rkv => san
2016-08-30 20:58 rkv Status assigned => resolved
2016-08-30 20:58 rkv Steps to Reproduce Updated View Revisions
2016-08-31 09:20 git Note Added: 0057313
2016-08-31 11:13 kgv Note Added: 0057317
2016-08-31 13:12 git Note Added: 0057328
2016-09-01 11:09 git Note Added: 0057377
2016-09-01 15:38 san Note Added: 0057391
2016-09-01 15:38 san Assigned To san => bugmaster
2016-09-01 15:38 san Status resolved => reviewed
2016-09-01 16:44 mkv Assigned To bugmaster => mkv
2016-09-01 17:26 git Note Added: 0057396
2016-09-02 13:21 mkv Note Added: 0057410
2016-09-02 13:22 mkv Note Added: 0057411
2016-09-02 13:22 mkv Note Added: 0057412
2016-09-02 13:22 mkv Assigned To mkv => rkv
2016-09-02 13:22 mkv Status reviewed => feedback
2016-09-02 13:22 mkv Test case number => bugs vis bug27567
2016-09-02 14:29 git Note Added: 0057417
2016-09-02 14:30 rkv Assigned To rkv => san
2016-09-02 14:30 rkv Status feedback => resolved
2016-09-02 14:30 rkv Steps to Reproduce Updated View Revisions
2016-09-02 14:38 san Note Added: 0057423
2016-09-02 14:38 san Assigned To san => bugmaster
2016-09-02 14:38 san Status resolved => reviewed
2016-09-02 14:51 mkv Assigned To bugmaster => mkv
2016-09-02 15:36 git Note Added: 0057429
2016-09-05 19:32 mkv Note Added: 0057486
2016-09-05 19:33 mkv Note Added: 0057487
2016-09-05 19:33 mkv Assigned To mkv => rkv
2016-09-05 19:33 mkv Status reviewed => assigned
2016-09-06 15:41 git Note Added: 0057521
2016-09-06 15:42 rkv Assigned To rkv => san
2016-09-06 15:42 rkv Status assigned => resolved
2016-09-06 15:52 san Note Added: 0057522
2016-09-06 15:52 san Assigned To san => bugmaster
2016-09-06 15:52 san Status resolved => reviewed
2016-09-06 15:53 san Note Edited: 0057522 View Revisions
2016-09-06 15:58 mkv Assigned To bugmaster => mkv
2016-09-06 17:11 mkv Note Added: 0057527
2016-09-06 17:11 mkv Assigned To mkv => rkv
2016-09-06 17:11 mkv Status reviewed => assigned
2016-09-06 17:27 san Note Added: 0057529
2016-09-09 16:45 git Note Added: 0057648
2016-09-12 19:30 san Note Added: 0057707
2016-09-12 19:30 san Status assigned => feedback
2016-09-14 13:56 git Note Added: 0057778
2016-09-14 14:06 rkv Relationship added related to 0027871
2016-09-14 14:34 git Note Added: 0057783
2016-09-14 16:55 git Note Added: 0057792
2016-09-14 16:59 rkv Note Added: 0057793
2016-09-14 16:59 rkv Assigned To rkv => san
2016-09-14 16:59 rkv Status feedback => resolved
2016-09-14 19:13 san Assigned To san => rkv
2016-09-14 19:13 san Status resolved => assigned
2016-09-14 19:15 san Relationship added related to 0027734
2016-09-14 19:32 git Note Added: 0057804
2016-09-14 19:33 san Assigned To rkv => san
2016-09-14 19:33 san Status assigned => resolved
2016-09-14 19:38 san Note Added: 0057806
2016-09-14 19:38 san Assigned To san => bugmaster
2016-09-14 19:38 san Status resolved => reviewed
2016-09-15 10:50 mkv Assigned To bugmaster => mkv
2016-09-15 15:20 mkv Note Added: 0057823
2016-09-15 15:20 mkv Assigned To mkv => rkv
2016-09-15 15:20 mkv Status reviewed => feedback
2016-09-15 17:24 git Note Added: 0057830
2016-09-15 17:26 rkv Assigned To rkv => mkv
2016-09-15 17:50 mkv Status feedback => reviewed
2016-09-19 13:55 mkv Note Added: 0057920
2016-09-19 13:55 git Note Added: 0057921
2016-09-19 13:56 mkv Note Added: 0057922
2016-09-19 13:56 mkv Assigned To mkv => bugmaster
2016-09-19 13:56 mkv Status reviewed => tested
2016-09-23 10:21 bugmaster Changeset attached => occt master a2f76b15
2016-09-23 10:21 bugmaster Status tested => verified
2016-09-23 10:21 bugmaster Resolution open => fixed
2016-10-28 21:45 git Note Added: 0059495
2016-12-09 16:30 user533 Status verified => closed
2016-12-09 16:38 user533 Fixed in Version => 7.1.0


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker