exiftool 9.00 memory leaks

Started by alain, August 18, 2012, 03:28:16 PM

Previous topic - Next topic

alain

Hi,

I downloaded and compiled the latest exiftool 9.00 on centos 6.3 and ran valgind to check for memory leaks.
The memory leaks reported by valgrind could be in perl. .. Would using a different perl executable and/or version
reduce the amount of leaks?

[adazzi@ldapclient Image-ExifTool-9.00]$ perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Can someone investigate and/or provide advice?

Thank you,

-A

Here is the trace ...

[adazzi@ldapclient src]$ valgrind /custom/centos_mp_rc6/bin/exiftool /data1/centos_mp_rc6/src/encoding/tests/198-MTS.MTS
==22785== Memcheck, a memory error detector
==22785== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==22785== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==22785== Command: /custom/centos_mp_rc6/bin/exiftool /data1/centos_mp_rc6/src/encoding/tests/198-MTS.MTS
==22785==
==22785== Conditional jump or move depends on uninitialised value(s)
==22785==    at 0x4EB2BEC: Perl_re_compile (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E6C315: Perl_pmruntime (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E9CF5A: Perl_yyparse (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4F06309: ??? (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4F07DC4: Perl_pp_require (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4ED19C5: Perl_runops_standard (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E795DE: Perl_call_sv (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E79B1C: Perl_call_list (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E62CD8: ??? (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E706B1: Perl_newATTRSUB (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E6F632: Perl_utilize (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E9DD86: Perl_yyparse (in /usr/lib64/perl5/CORE/libperl.so)
==22785==
==22785== Conditional jump or move depends on uninitialised value(s)
==22785==    at 0x4EB2BEC: Perl_re_compile (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E6C315: Perl_pmruntime (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E6C720: Perl_ck_split (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E6C9EC: Perl_convert (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E9DA9D: Perl_yyparse (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4F06309: ??? (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4F07DC4: Perl_pp_require (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4ED19C5: Perl_runops_standard (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E795DE: Perl_call_sv (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E79B1C: Perl_call_list (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E62CD8: ??? (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E706B1: Perl_newATTRSUB (in /usr/lib64/perl5/CORE/libperl.so)
==22785==
==22785== Conditional jump or move depends on uninitialised value(s)
==22785==    at 0x4EB2BEC: Perl_re_compile (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E6C315: Perl_pmruntime (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E9CF5A: Perl_yyparse (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E77C32: ??? (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x4E7A642: perl_parse (in /usr/lib64/perl5/CORE/libperl.so)
==22785==    by 0x400C3B: main (in /usr/bin/perl)
==22785==
ExifTool Version Number         : 8.99
File Name                       : 198-MTS.MTS
Directory                       : /data1/centos_mp_rc6/src/encoding/tests
File Size                       : 4.3 MB
File Modification Date/Time     : 2012:08:09 15:40:19-07:00
File Permissions                : rw-r--r--
File Type                       : M2TS
MIME Type                       : video/m2ts
Video Stream Type               : H.264 Video
Audio Stream Type               : A52/AC-3 Audio
Audio Bitrate                   : 448 kbps
Surround Mode                   : Not indicated
Audio Channels                  : 3/2
Image Width                     : 1440
Image Height                    : 1080
Date/Time Original              : 2011:10:13 14:05:11-07:00
Aperture Setting                : Auto
Gain                            : 0 dB
Exposure Program                : Program AE
White Balance                   : Auto
Focus                           : Auto (3.15)
Image Stabilization             : On (0x3f)
Exposure Time                   : 1/125
F Number                        : 2
Make                            : Sony
Camera Model Name               : HDR-TD10
Audio Sample Rate               : 48000
Duration                        : 2.97 s
Aperture                        : 2.0
Image Size                      : 1440x1080
Shutter Speed                   : 1/125
==22785==
==22785== HEAP SUMMARY:
==22785==     in use at exit: 6,513,258 bytes in 94,185 blocks
==22785==   total heap usage: 171,324 allocs, 77,139 frees, 10,604,191 bytes allocated
==22785==
==22785== LEAK SUMMARY:
==22785==    definitely lost: 30,432 bytes in 22 blocks
==22785==    indirectly lost: 6,481,394 bytes in 94,158 blocks
==22785==      possibly lost: 0 bytes in 0 blocks
==22785==    still reachable: 1,432 bytes in 5 blocks
==22785==         suppressed: 0 bytes in 0 blocks
==22785== Rerun with --leak-check=full to see details of leaked memory
==22785==
==22785== For counts of detected and suppressed errors, rerun with: -v
==22785== Use --track-origins=yes to see where uninitialised values come from
==22785== ERROR SUMMARY: 59 errors from 3 contexts (suppressed: 6 from 6)
[adazzi@ldapclient src]$

Phil Harvey

The only way to have a memory leak in Perl is if a cyclically-referenced block goes out of scope.

As far as I know, there are no problems like this in ExifTool.

The memory leaks you report are likely not memory leaks at all.  ExifTool builds entries in the tag tables dynamically when run.  These may appear as leaks, but they are intentional to speed processing of the next like-format file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).