[MPlayer-users] Memory Leak in mencoder

Rácz János nigra at freemail.hu
Thu Nov 1 08:40:49 CET 2007


Hi,

I've found an annoying bug in mencoder.

I use mencoder with my tv-tuner card in this way:

mencoder -tv 
driver=v4l2:norm=PAL-BG:chanlist=europe-east:saturation=100:width=768:height=576 
-ovc lavc -lavcopts vcodec=xvid:vbitrate=900 -oac mp3lame -lameopts 
cbr:br=128 -vf crop=720:544:24:16,pp=lb -o ~/film.avi tv://

It was a perfect method with Ubuntu Feisty. I installed Ubuntu Gutsy and 
with this method mencoder "had eaten" 1 GB RAM in 1 minute. If I use 
vcodec=mpeg4 it takes about 5 minutes.

I've tried it with the last Subversion and also with an older version of 
mencoder (from MPlayer-1.0pre8.tar.bz2 
<http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre8.tar.bz2>) and 
the result is the same.



System information:

Ubuntu 7.10 (Gutsy)

kernel:

2.6.22-14-generic #1 SMP

libc version:

-rwxr-xr-x 1 root root 1249520 2007-10-01 03:02 /lib/libc-2.6.1.so
lrwxrwxrwx 1 root root      13 2007-10-28 09:37 /lib/libc.so.6 -> 
libc-2.6.1.so

gcc and ld versions:

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v 
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

GNU ld (GNU Binutils for Ubuntu) 2.18

binutils version:

GNU assembler (GNU Binutils for Ubuntu) 2.18
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `i486-linux-gnu'.

CPU info:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping        : 1
cpu MHz         : 3207.509
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe 
constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 6419.35
clflush size    : 64

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping        : 1
cpu MHz         : 3207.509
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe 
constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 6415.03
clflush size    : 64

Video card:

GeForce FX 5700LE

Video driver:

nvidia-glx-new 100.14.19+2.6.22.4-14-9 (Gutsy)
(official Gutsy package)

Sound card & driver:

82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller Intel (Corporation),
ALSA (official Gutsy package)

My tv-tuner is "PixelView PlayTV Pro Ultra"
(Conexant CX23880/1/2/3 PCI)

I use it with "modprobe cx88xx card=27 tuner=38; modprobe cx8800".


With valgrind debugging software I got:

==6287== ERROR SUMMARY: 8 errors from 5 contexts (suppressed: 109 from 1)
==6287==
==6287== 1 errors in context 1 of 5:
==6287== Syscall param ioctl(generic) points to uninitialised byte(s)
==6287== at 0x40007F2: (within /lib/ld-2.6.1.so)
==6287== by 0x4AA1918: ioctl (in /lib/tls/i686/cmov/libc-2.6.1.so)
==6287== by 0x81DA285: (within /usr/bin/mencoder)
==6287== Address 0xBE829488 is on thread 1's stack
==6287==
==6287== 1 errors in context 2 of 5:
==6287== Syscall param ioctl(generic) points to uninitialised byte(s)
==6287== at 0x40007F2: (within /lib/ld-2.6.1.so)
==6287== by 0x4AA1918: ioctl (in /lib/tls/i686/cmov/libc-2.6.1.so)
==6287== by 0x81DBB50: (within /usr/bin/mencoder)
==6287== Address 0xBE82946C is on thread 1's stack
==6287==
==6287== 1 errors in context 3 of 5:
==6287== Syscall param ioctl(generic) points to uninitialised byte(s)
==6287== at 0x40007F2: (within /lib/ld-2.6.1.so)
==6287== by 0x0: ???
==6287== Address 0xBE82945C is on thread 1's stack
==6287==
==6287== 1 errors in context 4 of 5:
==6287== Syscall param ioctl(generic) points to uninitialised byte(s)
==6287== at 0x40007F2: (within /lib/ld-2.6.1.so)
==6287== by 0x4AA1918: ioctl (in /lib/tls/i686/cmov/libc-2.6.1.so)
==6287== by 0x81DACE5: (within /usr/bin/mencoder)
==6287== Address 0xBE82940C is on thread 1's stack
==6287==
==6287== 4 errors in context 5 of 5:
==6287== Syscall param ioctl(generic) points to uninitialised byte(s)
==6287== at 0x40007F2: (within /lib/ld-2.6.1.so)
==6287== by 0x4AA1918: ioctl (in /lib/tls/i686/cmov/libc-2.6.1.so)
==6287== by 0x81D8210: (within /usr/bin/mencoder)
==6287== Address 0xBE8293DC is on thread 1's stack
--6287--
--6287-- supp: 109 dl-hack3
==6287==
==6287== IN SUMMARY: 8 errors from 5 contexts (suppressed: 109 from 1)
==6287==
==6287== malloc/free: in use at exit: 3,343,104 bytes in 3,484 blocks.
==6287== malloc/free: 7,976 allocs, 4,492 frees, 73,669,483 bytes allocated.
==6287==
==6287== searching for pointers to 3,484 not-freed blocks.
==6287== checked 3,973,068 bytes.
==6287==
==6287== LEAK SUMMARY:
==6287== definitely lost: 1,355 bytes in 12 blocks.
==6287== possibly lost: 46,445 bytes in 1 blocks.
==6287== still reachable: 3,295,304 bytes in 3,471 blocks.
==6287== suppressed: 0 bytes in 0 blocks.
==6287== Rerun with --leak-check=full to see details of leaked memory.
--6287-- memcheck: sanity checks: 690 cheap, 28 expensive
--6287-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--6287-- memcheck: auxmaps: 0 searches, 0 comparisons
--6287-- memcheck: SMs: n_issued = 1225 (19600k, 19M)
--6287-- memcheck: SMs: n_deissued = 938 (15008k, 14M)
--6287-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M)
--6287-- memcheck: SMs: max_undefined = 76 (1216k, 1M)
--6287-- memcheck: SMs: max_defined = 494 (7904k, 7M)
--6287-- memcheck: SMs: max_non_DSM = 1076 (17216k, 16M)
--6287-- memcheck: max sec V bit nodes: 0 (0k, 0M)
--6287-- memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0)
--6287-- memcheck: max shadow mem size: 17520k, 17M
--6287-- translate: fast SP updates identified: 15,523 ( 92.5%)
--6287-- translate: generic_known SP updates identified: 823 ( 4.9%)
--6287-- translate: generic_unknown SP updates identified: 434 ( 2.5%)
--6287-- tt/tc: 25,449 tt lookups requiring 28,045 probes
--6287-- tt/tc: 25,449 fast-cache updates, 2 flushes
--6287-- transtab: new 11,331 (290,152 -> 4,745,843; ratio 163:10) [0 scs]
--6287-- transtab: dumped 0 (0 -> ??)
--6287-- transtab: discarded 0 (0 -> ??)
--6287-- scheduler: 55,523,037 jumps (bb entries).
--6287-- scheduler: 690/36,279 major/minor sched events.
--6287-- sanity: 691 cheap, 28 expensive checks.
--6287-- exectx: 30,011 lists, 295 contexts (avg 0 per list)
--6287-- exectx: 12,585 searches, 12,291 full compares (976 per 1000)
--6287-- exectx: 0 cmp2, 235 cmp4, 0 cmpAll




I hope it helps your work.

Best wishes,

nigra












More information about the MPlayer-users mailing list