Page MenuHomePhabricator

memory errors in mitkDataStorageTest
Closed, ResolvedPublic

Description

valgrind complains about sevaral errors originating from mitkDataStorageTest:

http://mbits/cdash/viewDynamicAnalysisFile.php?id=24412

These errors should be fixed or suppressed (if not within the scope of MITK)

Event Timeline

[SVN revision 21339]
FIX (#3344): mimimum restructuring to fix some warnings, make parts more readable

mitkDataStorageTest initializes an empty image for which minimum and maximum voxel values were undefined. mitkLevelWindow copied these, resulting in undefined member variables. This again resulted in the errors reported by Valgrind. When using a real image in the test these error messages were gone. Some memory leaks are still present.

2, 20 bytes in 5 blocks are still reachable, but this memory leak is not in MITK.

(In reply to comment #4)

2, 20 bytes in 5 blocks are still reachable, but this memory leak is not in
MITK.

"Still reachable" does not necessarily mean a memory leak.

What about your sentence "mitkDataStorageTest initializes an empty image for which minimum and maximum voxel values were undefined."? Could these values be set to meaningful default values?

The problem is, that mitkImage tries to compute statistics for all initialized images, even it is an empty one. The mitkDataStorageTest used an empty image for testing. This involves a lot of error messages by valgrind.

[SVN revision 22718]
ENH (#3344): used a well definied image instead of an empty image for testing. This removed error messages reported by valgrind.

(In reply to comment #7)

The problem is, that mitkImage tries to compute statistics for all initialized
images, even it is an empty one.

"Empty" should be well defined, right? I think for empty image, calculating the histogram should be easy. Or did you mean uninitialized ones?

We used a real image Core/Code/Testing/Data/US4DDyl.pic.gz for mitkDataStorageTest instead of an empty image. The error messages by valgrind were gone.

Testing bugs are part of their respective modules -> changing component to other, please assign appropriate component.