[digikam] [Bug 326525] New: Severe memory leak during maintainance scan for rebuild thumbnails

classic Classic list List threaded Threaded
87 messages Options
12345
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #55 from Gilles Caulier <[hidden email]> ---
Raphael,

My last comment is about digiKam compiled with internal libpgf with OpenMP
support disabled.

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #56 from Raphael Schweizer <[hidden email]> ---
Created attachment 83403
  --> https://bugs.kde.org/attachment.cgi?id=83403&action=edit
Patch out OpenMP #pragma s

Gilles,

first two must be false positives. The value in question (m_maxAbsValue) is
initialized in a method (CMacroBlock::Init) called from the CMacroBlock
constructor.

Memory leaks are reported on lines "#pragma omp parallel for default(shared)".
Seemingly OpenMP leaks some memory here, even though being disabled. Searching
the internet leads to other people having similar problems. As I'm not an
OpenMP guru my best guess is to patch these lines out for the time being. I'll
see for someone more into OpenMP to investigate this issue.

- Raphael

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #57 from Raphael Schweizer <[hidden email]> ---
Gilles,

Do you compile using -fopenmp and disable OpenMP just for libPGF (how, which
flag?) or are you using gcc default (AFAIK no OpenMP)? I'm puzzled by the fact
that libPGF is calling into libgomp. Is there anything we can do to better
support disabling OpenMP?

- Raphael

(In reply to comment #55)
> Raphael,
>
> My last comment is about digiKam compiled with internal libpgf with OpenMP
> support disabled.
>
> Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #58 from Gilles Caulier <[hidden email]> ---
Raphael,

At cmake configuration time, this flag is turned off (default) :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/CMakeLists.txt#L17

Which is managed here to set compilation flags :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/CMakeLists.txt#L272

In libpgf code, this flag is used here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/3rdparty/libpgf/PGFplatform.h#L608

I don't know why libpgf call libgomp here...

Gilles

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #59 from Raphael Schweizer <[hidden email]> ---
Gilles,

nostra culpa, I'll upload a fixed version tonight.

- Raphael

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #60 from Raphael Schweizer <[hidden email]> ---
Gilles,

r122 @sourceforge ready with guarded OpenMP #pragma s and some improvements
regarding the coverity issues.

- Raphael

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #61 from Gilles Caulier <[hidden email]> ---
Git commit b494c2a021e3fd85eeb1a5eba5a9e449e4dbe114 by Gilles Caulier.
Committed on 08/11/2013 at 07:07.
Pushed by cgilles into branch 'master'.

update internal libpgf source code to last revision #r121 from SF repository

M  +2    -1    libs/3rdparty/libpgf/Decoder.cpp
M  +4    -0    libs/3rdparty/libpgf/Decoder.h
M  +8    -1    libs/3rdparty/libpgf/Encoder.cpp
M  +5    -1    libs/3rdparty/libpgf/Encoder.h
M  +8    -1    libs/3rdparty/libpgf/PGFimage.cpp
M  +16   -16   libs/3rdparty/libpgf/PGFplatform.h
M  +2    -2    libs/3rdparty/libpgf/PGFtypes.h
M  +6    -1    libs/3rdparty/libpgf/Subband.cpp

http://commits.kde.org/digikam/b494c2a021e3fd85eeb1a5eba5a9e449e4dbe114

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #62 from Gilles Caulier <[hidden email]> ---
Sorry, commit from comment #61 is libpgf revision #122 from SF repository (not
#121)

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #63 from Gilles Caulier <[hidden email]> ---
Raphael,

All memory leak from libpgf are disappear with revision #122, but multiple
conditional jump or move depends on uninitialized values (more than revision
#121). Look below. This can be false warnings, but this must be checked :

==8229== Thread 17:
==8229== Conditional jump or move depends on uninitialised value(s)
==8229==    at 0x80C5B55: CSubband::Quantize(int) (Subband.cpp:137)
==8229==    by 0x80C6B0E: CWaveletTransform::ForwardTransform(int, int)
(WaveletTransform.cpp:164)
==8229==    by 0x80BDBA7: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:961)
==8229==    by 0x80BE720: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==8229==    by 0x80C9F2E: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==8229==    by 0x80C938A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==8229==    by 0x80AA259:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==8229==    by 0x80A7BD8: Digikam::ThumbnailCreator::load(QString const&, QRect
const&, bool) const (thumbnailcreator.cpp:267)
==8229==    by 0x80A7785: Digikam::ThumbnailCreator::load(QString const&) const
(thumbnailcreator.cpp:199)
==8229==    by 0x80B6665: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)
==8229==    by 0x8091530: Digikam::LoadSaveThread::run()
(loadsavethread.cpp:136)
==8229==    by 0x80CF279: Digikam::DynamicThread::DynamicThreadPriv::run()
(dynamicthread.cpp:186)

==8229== Conditional jump or move depends on uninitialised value(s)
==8229==    at 0x80B9DDD: CEncoder::WriteValue(CSubband*, int)
(Encoder.cpp:328)
==8229==    by 0x80B9AA4: CEncoder::Partition(CSubband*, int, int, int, int)
(Encoder.cpp:259)
==8229==    by 0x80C5D81: CSubband::ExtractTile(CEncoder&, bool, unsigned int,
unsigned int) (Subband.cpp:190)
==8229==    by 0x80BE25E: CPGFImage::WriteLevel() (PGFimage.cpp:1051)
==8229==    by 0x80BE5EF: CPGFImage::WriteImage(CPGFStream*, bool (*)(double,
bool, void*), void*) (PGFimage.cpp:1125)
==8229==    by 0x80BE73B: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1170)
==8229==    by 0x80C9F2E: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==8229==    by 0x80C938A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==8229==    by 0x80AA259:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==8229==    by 0x80A7BD8: Digikam::ThumbnailCreator::load(QString const&, QRect
const&, bool) const (thumbnailcreator.cpp:267)
==8229==    by 0x80A7785: Digikam::ThumbnailCreator::load(QString const&) const
(thumbnailcreator.cpp:199)
==8229==    by 0x80B6665: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)

==8229== Conditional jump or move depends on uninitialised value(s)
==8229==    at 0x80BA7B8: CEncoder::CMacroBlock::DecomposeBitplane(unsigned
int, unsigned int, unsigned int, unsigned int*, unsigned int*, unsigned int*,
unsigned int&, unsigned int&) (Encoder.cpp:654)
==8229==    by 0x80BA307: CEncoder::CMacroBlock::BitplaneEncode()
(Encoder.cpp:520)
==8229==    by 0x80B9E52: CEncoder::EncodeBuffer(ROIBlockHeader)
(Encoder.cpp:348)
==8229==    by 0x80B9D74: CEncoder::WriteValue(CSubband*, int)
(Encoder.cpp:324)
==8229==    by 0x80B9AA4: CEncoder::Partition(CSubband*, int, int, int, int)
(Encoder.cpp:259)
==8229==    by 0x80C5D81: CSubband::ExtractTile(CEncoder&, bool, unsigned int,
unsigned int) (Subband.cpp:190)
==8229==    by 0x80BE25E: CPGFImage::WriteLevel() (PGFimage.cpp:1051)
==8229==    by 0x80BE5EF: CPGFImage::WriteImage(CPGFStream*, bool (*)(double,
bool, void*), void*) (PGFimage.cpp:1125)
==8229==    by 0x80BE73B: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1170)
==8229==    by 0x80C9F2E: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==8229==    by 0x80C938A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==8229==    by 0x80AA259:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)

==8229== Thread 16:
==8229== Conditional jump or move depends on uninitialised value(s)
==8229==    at 0x80BA9F6: CEncoder::CMacroBlock::NumberOfBitplanes()
(Encoder.cpp:747)
==8229==    by 0x80BA219: CEncoder::CMacroBlock::BitplaneEncode()
(Encoder.cpp:502)
==8229==    by 0x80B9E52: CEncoder::EncodeBuffer(ROIBlockHeader)
(Encoder.cpp:348)
==8229==    by 0x80B9D03: CEncoder::Flush() (Encoder.cpp:314)
==8229==    by 0x80BE687: CPGFImage::WriteImage(CPGFStream*, bool (*)(double,
bool, void*), void*) (PGFimage.cpp:1135)
==8229==    by 0x80BE73B: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1170)
==8229==    by 0x80C9F2E: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==8229==    by 0x80C938A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==8229==    by 0x80AA259:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==8229==    by 0x80A7BD8: Digikam::ThumbnailCreator::load(QString const&, QRect
const&, bool) const (thumbnailcreator.cpp:267)
==8229==    by 0x80A7785: Digikam::ThumbnailCreator::load(QString const&) const
(thumbnailcreator.cpp:199)
==8229==    by 0x80B6665: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)
==8229==
==8229== Conditional jump or move depends on uninitialised value(s)
==8229==    at 0x80BAA27: CEncoder::CMacroBlock::NumberOfBitplanes()
(Encoder.cpp:748)
==8229==    by 0x80BA219: CEncoder::CMacroBlock::BitplaneEncode()
(Encoder.cpp:502)
==8229==    by 0x80B9E52: CEncoder::EncodeBuffer(ROIBlockHeader)
(Encoder.cpp:348)
==8229==    by 0x80B9D03: CEncoder::Flush() (Encoder.cpp:314)
==8229==    by 0x80BE687: CPGFImage::WriteImage(CPGFStream*, bool (*)(double,
bool, void*), void*) (PGFimage.cpp:1135)
==8229==    by 0x80BE73B: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1170)
==8229==    by 0x80C9F2E: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==8229==    by 0x80C938A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==8229==    by 0x80AA259:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==8229==    by 0x80A7BD8: Digikam::ThumbnailCreator::load(QString const&, QRect
const&, bool) const (thumbnailcreator.cpp:267)
==8229==    by 0x80A7785: Digikam::ThumbnailCreator::load(QString const&) const
(thumbnailcreator.cpp:199)
==8229==    by 0x80B6665: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #64 from Gilles Caulier <[hidden email]> ---
Raphael,

Next stages here will are :

- to turn on OpenMP support for libpgf and check if crash is reproducible as
explained in comment #35.
- to run again Coverity Scan to see if all main reports are fixed now.

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #65 from Gilles Caulier <[hidden email]> ---
Raphael,

There are few warnings reported by cppcheck. Nothing urgent, just informative
and good to know :

[gilles@localhost libpgf]$ cppcheck --enable=all .
...
[Decoder.h:46]: (style) The class 'CDecoder' does not have a constructor.
[Decoder.cpp:499]: (style) Throwing a copy of the caught exception instead of
rethrowing the original exception.
[Decoder.cpp:536]: (warning) Redundant assignment of 'wordLen' to itself.
[Decoder.cpp:595]: (warning) Redundant assignment of 'wordLen' to itself.
[BitStream.h:129]: (style) The scope of the variable 'hiCount' can be reduced.
[Decoder.h:46]: (style) 'class CDecoder' does not have a copy constructor which
is recommended since the class contains a pointer to allocated memory.
...
[Encoder.h:46]: (style) The class 'CEncoder' does not have a constructor.
[Encoder.cpp:405]: (style) Variable 'h' is assigned a value that is never used.
[Encoder.cpp:744]: (style) The scope of the variable 'cnt' can be reduced.
[Encoder.cpp:570]: (style) Unsigned variable 'wordPos' can't be negative so it
is unnecessary to test it.
[Encoder.cpp:583]: (style) Unsigned variable 'wordPos' can't be negative so it
is unnecessary to test it.
[Encoder.cpp:593]: (style) Unsigned variable 'wordPos' can't be negative so it
is unnecessary to test it.
[Encoder.cpp:605]: (style) Unsigned variable 'wordPos' can't be negative so it
is unnecessary to test it.
[Encoder.cpp:614]: (style) Unsigned variable 'm_codePos' can't be negative so
it is unnecessary to test it.
[Encoder.cpp:769]: (style) Unsigned variable 'codePos' can't be negative so it
is unnecessary to test it.
[Encoder.h:46]: (style) 'class CEncoder' does not have a copy constructor which
is recommended since the class contains a pointer to allocated memory.
...
[PGFimage.cpp:1294]: (error) syntax error
[PGFimage.cpp:637]: (style) Unsigned variable 'len' can't be negative so it is
unnecessary to test it.
[PGFimage.cpp:680]: (style) Unsigned variable 'len' can't be negative so it is
unnecessary to test it.
...
[gilles@localhost libpgf]$

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #66 from Gilles Caulier <[hidden email]> ---
Rapahel,

I don't check your change about OpenMP support, but now, crash cannot be
reproduced as explained in comment #35. I can run qtpgftest command line tool :

[gilles@localhost tests]$ ./qtpgftest
unnamed app(22268)/digikam (core) main: Using LibPGF version:  "6.13.45"
unnamed app(22268)/digikam (core) main: Using OpenMP with LibPGF :  yes
unnamed app(22268)/digikam (core) main: Generate PGF file using file stream
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
RGB => ARGB
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
PGF image settings:
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   width:  256
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   height:  170
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   nLevels:  0
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   quality:  0
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   bpp:  32
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   channels:  4
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   mode:  17
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   usedBitsPerChannel:  0
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageFile: file
size written :  80806
unnamed app(22268)/digikam (core) main: Generate PGF file using data stream
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageData: PGF
stream memory allocation in bytes:  174080
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
RGB => ARGB
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
PGF image settings:
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   width:  256
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   height:  170
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   nLevels:  0
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   quality:  0
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   bpp:  32
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   channels:  4
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   mode:  17
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageDataToStream:
   usedBitsPerChannel:  0
unnamed app(22268)/digikam (core) Digikam::PGFUtils::writePGFImageData: data
size written :  80806
unnamed app(22268)/digikam (core) main: PGF Encoding time:  0.08  s
unnamed app(22268)/digikam (core) main: Load PGF file generated by data stream
unnamed app(22268)/digikam (core) Digikam::PGFUtils::readPGFImageData: image
data stream size is :  80806
unnamed app(22268)/digikam (core) Digikam::PGFUtils::readPGFImageData: PGF
image is open
unnamed app(22268)/digikam (core) Digikam::PGFUtils::readPGFImageData: PGF
image is read
unnamed app(22268)/digikam (core) Digikam::PGFUtils::readPGFImageData: PGF
image is decoded
unnamed app(22268)/digikam (core) main: PGF Decoding time:  0.1  s
unnamed app(22268)/digikam (core) main: Generate JPG file to compare
performances
unnamed app(22268)/digikam (core) main: JPG Encoding time:  0  s
unnamed app(22268)/digikam (core) main: JPG Decoding time:  0  s
unnamed app(22268)/digikam (core) main: Generate PNG file to compare
performances
unnamed app(22268)/digikam (core) main: PNG Encoding time:  0.01  s
libpng warning: Unknown iTXt compression type or method
unnamed app(22268)/digikam (core) main: PNG Decoding time:  0  s
[gilles@localhost tests]$

But valgrind report few traces about memory leak when OpenMP support is enabled
:

[gilles@localhost tests]$ valgrind --tool=memcheck --leak-check=full
--error-limit=no ./qtpgftest
==22448== Memcheck, a memory error detector
==22448== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==22448== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==22448== Command: ./qtpgftest
==22448==
...
==22448==
==22448== HEAP SUMMARY:
==22448==     in use at exit: 2,219,171 bytes in 470 blocks
==22448==   total heap usage: 23,798 allocs, 23,328 frees, 39,735,306 bytes
allocated
...
==22448== 2,464 bytes in 7 blocks are possibly lost in loss record 247 of 260
==22448==    at 0x4C26DFF: calloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22448==    by 0x4011008: _dl_allocate_tls (in /usr/lib64/ld-2.17.so)
==22448==    by 0x59CB8B8: pthread_create@@GLIBC_2.2.5 (in
/usr/lib64/libpthread-2.17.so)
==22448==    by 0x4E38CBD: ??? (in /usr/lib64/libgomp.so.1.0.0)
==22448==    by 0x40AD03: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:930)
==22448==    by 0x40B7C0: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==22448==    by 0x417611: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==22448==    by 0x4167B3: Digikam::PGFUtils::writePGFImageFile(QImage const&,
QString const&, int, bool) (pgfutils.cpp:152)
==22448==    by 0x402992: main (qtpgftest.cpp:63)
...
==22448== 1,032,472 bytes in 7 blocks are definitely lost in loss record 259 of
260
==22448==    at 0x4C285F1: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22448==    by 0x40686A: CEncoder::CEncoder(CPGFStream*, PGFPreHeader,
PGFHeader, PGFPostHeader const&, unsigned long long&, bool) (Encoder.cpp:101)
==22448==    by 0x40AE60: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:982)
==22448==    by 0x40B7C0: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==22448==    by 0x417611: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==22448==    by 0x416ABD: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==22448==    by 0x402AF3: main (qtpgftest.cpp:74)
==22448==
==22448== 1,032,472 bytes in 7 blocks are definitely lost in loss record 260 of
260
==22448==    at 0x4C285F1: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22448==    by 0x40686A: CEncoder::CEncoder(CPGFStream*, PGFPreHeader,
PGFHeader, PGFPostHeader const&, unsigned long long&, bool) (Encoder.cpp:101)
==22448==    by 0x40AE60: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:982)
==22448==    by 0x40B7C0: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==22448==    by 0x417611: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==22448==    by 0x4167B3: Digikam::PGFUtils::writePGFImageFile(QImage const&,
QString const&, int, bool) (pgfutils.cpp:152)
==22448==    by 0x402992: main (qtpgftest.cpp:63)
==22448==
==22448== LEAK SUMMARY:
==22448==    definitely lost: 2,066,960 bytes in 35 blocks
==22448==    indirectly lost: 7,540 bytes in 63 blocks
==22448==      possibly lost: 2,464 bytes in 7 blocks
==22448==    still reachable: 142,207 bytes in 365 blocks
==22448==         suppressed: 0 bytes in 0 blocks
==22448== Reachable blocks (those to which a pointer was found) are not shown.
==22448== To see them, rerun with: --leak-check=full --show-reachable=yes
==22448==
==22448== For counts of detected and suppressed errors, rerun with: -v
==22448== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 2 from 2)
[gilles@localhost tests]$

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #67 from Gilles Caulier <[hidden email]> ---
Raphael,

running digiKam into valgrind with libpgf OpenMP support confirm memory leak :

==22590== 368 bytes in 1 blocks are possibly lost in loss record 22,738 of
25,730
==22590==    at 0x4C26DFF: calloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22590==    by 0x4011008: _dl_allocate_tls (in /usr/lib64/ld-2.17.so)
==22590==    by 0xFD028B8: pthread_create@@GLIBC_2.2.5 (in
/usr/lib64/libpthread-2.17.so)
==22590==    by 0x10AACCBD: ??? (in /usr/lib64/libgomp.so.1.0.0)
==22590==    by 0x80BDA49: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:930)
==22590==    by 0x80BE510: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==22590==    by 0x80CA2EE: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==22590==    by 0x80C974A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==22590==    by 0x80AA2F9:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==22590==    by 0x80A7C78: Digikam::ThumbnailCreator::load(QString const&,
QRect const&, bool) const (thumbnailcreator.cpp:267)
==22590==    by 0x80A7825: Digikam::ThumbnailCreator::load(QString const&)
const (thumbnailcreator.cpp:199)
==22590==    by 0x80B6705: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)

==22590== 5,309,856 bytes in 36 blocks are possibly lost in loss record 25,727
of 25,730
==22590==    at 0x4C285F1: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22590==    by 0x80B9531: CEncoder::CEncoder(CPGFStream*, PGFPreHeader,
PGFHeader, PGFPostHeader const&, unsigned long long&, bool) (Encoder.cpp:101)
==22590==    by 0x80BDBAC: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:982)
==22590==    by 0x80BE510: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==22590==    by 0x80CA2EE: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==22590==    by 0x80C974A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==22590==    by 0x80AA2F9:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==22590==    by 0x80A7C78: Digikam::ThumbnailCreator::load(QString const&,
QRect const&, bool) const (thumbnailcreator.cpp:267)
==22590==    by 0x80A7825: Digikam::ThumbnailCreator::load(QString const&)
const (thumbnailcreator.cpp:199)
==22590==    by 0x80B6705: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)
==22590==    by 0x80915D0: Digikam::LoadSaveThread::run()
(loadsavethread.cpp:136)
==22590==    by 0x80CF639: Digikam::DynamicThread::DynamicThreadPriv::run()
(dynamicthread.cpp:186)

==22590== 59,735,880 bytes in 405 blocks are definitely lost in loss record
25,730 of 25,730
==22590==    at 0x4C285F1: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22590==    by 0x80B9531: CEncoder::CEncoder(CPGFStream*, PGFPreHeader,
PGFHeader, PGFPostHeader const&, unsigned long long&, bool) (Encoder.cpp:101)
==22590==    by 0x80BDBAC: CPGFImage::WriteHeader(CPGFStream*)
(PGFimage.cpp:982)
==22590==    by 0x80BE510: CPGFImage::Write(CPGFStream*, unsigned int*, bool
(*)(double, bool, void*), void*) (PGFimage.cpp:1167)
==22590==    by 0x80CA2EE: Digikam::PGFUtils::writePGFImageDataToStream(QImage
const&, CPGFStream&, int, unsigned int&, bool) (pgfutils.cpp:288)
==22590==    by 0x80C974A: Digikam::PGFUtils::writePGFImageData(QImage const&,
QByteArray&, int, bool) (pgfutils.cpp:184)
==22590==    by 0x80AA2F9:
Digikam::ThumbnailCreator::storeInDatabase(Digikam::ThumbnailInfo const&,
Digikam::ThumbnailImage const&) const (thumbnailcreator.cpp:695)
==22590==    by 0x80A7C78: Digikam::ThumbnailCreator::load(QString const&,
QRect const&, bool) const (thumbnailcreator.cpp:267)
==22590==    by 0x80A7825: Digikam::ThumbnailCreator::load(QString const&)
const (thumbnailcreator.cpp:199)
==22590==    by 0x80B6705: Digikam::ThumbnailLoadingTask::execute()
(thumbnailtask.cpp:172)
==22590==    by 0x80915D0: Digikam::LoadSaveThread::run()
(loadsavethread.cpp:136)
==22590==    by 0x80CF639: Digikam::DynamicThread::DynamicThreadPriv::run()
(dynamicthread.cpp:186)

Ask you can see, memory leaks are not negligible if OPenMP support is enabled.
I always run digiKam in same condition : I stop thumbnails generator at 1%
(else it too long under valgrind).

Nota : digiKam do not crash imediatly when openMp support is enabled, as i have
seen in the pass.

To resume :

- libpgf without OpenMP support : no memory leak.
- libpgf with OpenMP support : no crash but important memory leak.

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #68 from Raphael Schweizer <[hidden email]> ---
Gilles,

- UNINIT/JUMP warnings are false positives (I'll check and mark accordingly on
coverity when new analysis is available).
- Memory leak @CEncoder::CEncoder(Encoder.cpp:101) FIXED (soon on SF); other
OpenMP memory leak must remain low-priority for the time being (we do not have
sufficient resources to check with valgrind/gcc/libgomp, if time allows we'll
at least check with VC++ [and Intel])
- cppcheck: fixed two issued (others are related to little/big endian
conditionals), soon on SF

Next steps: Dario will intermittently work on CMake toolchain and eventually
OpenMP issues

- Raphael

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #69 from Raphael Schweizer <[hidden email]> ---
r123 with said FIXes now available @SF

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #70 from Gilles Caulier <[hidden email]> ---
Git commit 2a5aadd60a23bd61b74722125dc25677556422a4 by Gilles Caulier.
Committed on 08/11/2013 at 10:59.
Pushed by cgilles into branch 'master'.

update internal libpgf source code to last revision #r123 from SF repository

M  +1    -1    libs/3rdparty/libpgf/Decoder.cpp
M  +8    -3    libs/3rdparty/libpgf/Encoder.cpp

http://commits.kde.org/digikam/2a5aadd60a23bd61b74722125dc25677556422a4

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #71 from Gilles Caulier <[hidden email]> ---
Raphael,

About CMake toolchain, you just need to sync svn libpgf cmakeport branch with
trunk, and sync back this branch in trunk to complete job.

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #72 from Raphael Schweizer <[hidden email]> ---
Gilles,

unfortunately it's not that trivial (for us) as we have > 10 different build
configurations in our Visual Studio project. We'd like to change everything to
CMake but need to understand its configuration first (i.e. how to generate our
configurations from CMake). Your CMake branch obviously is an excellent
starting point. Thanks!

- Raphael

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Gilles Caulier-4
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #73 from Gilles Caulier <[hidden email]> ---
Raphael,

To configure cmake to build VisualC++ project, just run this script :

http://sourceforge.net/p/libpgf/code/HEAD/tree/cmakeport/libpgf/bootstrap.msvc.bat

this will make nmake rules to compile under Windows console. You can change
cmake -G option to make VisualC++ project in the same way. For ex, to generate
Visual C++ 2010 SLN files :

cmake -G "Visual Studio 10"

... as explained here :

http://stackoverflow.com/questions/395169/using-cmake-to-generate-visual-studio-c-project-files

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 326525] Severe memory leak during maintainance scan for rebuild thumbnails

Raphael Schweizer
In reply to this post by James R. Shipman
https://bugs.kde.org/show_bug.cgi?id=326525

--- Comment #74 from Raphael Schweizer <[hidden email]> ---
Gilles,

thanks for the SO link. I found the following there:
"One more important thing to know about is the lack of support (afaik) for
'Solution Configurations' in CMake. As it stands, you have to generate two
directories with projects/solutions - one for each build type (debug, release,
etc.). There is no direct support for more sophisticated features - in other
words: switching between configurations won't give you what you might expect."
which is exactly our problem. As stated in my last post we have > 10 such
"configurations" for release, debug, omp, 16bit, ROI/nonROI and combinations
thereof. In Visual Studio we can easily switch between them by just selecting
from a drop down menu. We'd like to keep this as convenient as possible... In
principle we "just" need to translate our configurations to CMake, but there
seem to be related issues with the VS generator (see CMake bugtracker) and we
need to distil workarounds from their mailing list as the documentation is
allegedly out of sync with the implementation... which in practice makes this a
tedious task.

- Raphael

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
12345