[Bug?] mp3 encoding issue with ffmpeg

Need help? Post your questions here.
gurutech
Contributor
Contributor
Posts: 323
Joined: 02 Jan 2013, 04:56
Has thanked: 11 times
Been thanked: 105 times

[Bug?] mp3 encoding issue with ffmpeg

Unread post by gurutech »

I believe I have found a possible issue with MadSonic (and Subsonic) and its use of ffmpeg to transcode music into streaming MP3 format.

I am running MadSonic 4.8 beta 3 on Centoa 6.3 and had a terminal window open and I started seeing messages similar to this:

*** glibc detected *** /var/subsonic/transcode/ffmpeg: double free or corruption (!prev): 0x09ba4b40 ***
======= Backtrace: =========
[0x8b6e02e]
[0x8b723a9]
[0x8236235]
======= Memory map: ========
00565000-00566000 r-xp 00000000 00:00 0 [vdso]
08048000-09046000 r-xp 00000000 fd:00 406356 /var/subsonic/transcode/ffmpeg
09046000-0906c000 rw-p 00ffd000 fd:00 406356 /var/subsonic/transcode/ffmpeg
0906c000-096a6000 rw-p 00000000 00:00 0
09b1f000-09f40000 rw-p 00000000 00:00 0 [heap]
f6100000-f6121000 rw-p 00000000 00:00 0
f6121000-f6200000 ---p 00000000 00:00 0
f6218000-f623c000 rw-p 00000000 00:00 0
f625e000-f63be000 rw-p 00000000 00:00 0
f63be000-f63bf000 ---p 00000000 00:00 0
f63bf000-f6dbf000 rw-p 00000000 00:00 0
f6dbf000-f6dc0000 ---p 00000000 00:00 0
f6dc0000-f77c0000 rw-p 00000000 00:00 0
fffdb000-ffff0000 rw-p 00000000 00:00 0 [stack]
Totally seems to be an ffmpeg error, so I looked it up, and found a few resources pointing to attempting to run the program under valgrind. So I installed that and ran Subsonic through valgrind, and came up with this:

Code: Select all

==1702== Memcheck, a memory error detector
==1702== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==1702== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==1702== Command: /usr/bin/subsonic
==1702== 
--1702-- Valgrind options:
--1702--    -v
--1702--    --leak-check=full
--1702-- Contents of /proc/version:
--1702--   Linux version 2.6.32-279.19.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Dec 19 07:05:20 UTC 2012
--1702-- Arch and hwcaps: AMD64, amd64-sse3-cx16-lzcnt
--1702-- Page sizes: currently 4096, max supported 4096
--1702-- Valgrind library directory: /usr/lib64/valgrind
--1702-- Reading syms from /bin/bash (0x400000)
--1702--    object doesn't have a symbol table
--1702-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux (0x38000000)
--1702--    object doesn't have a dynamic symbol table
--1702-- Reading syms from /lib64/ld-2.12.so (0x3c5f600000)
--1702-- Reading suppressions file: /usr/lib64/valgrind/default.supp
--1702-- REDIR: 0x3c5f6174a0 (strlen) redirected to 0x38042ae7 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--1702-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so (0x4801000)
--1702-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so (0x4a02000)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5f6174a0 (strlen              ) R-> 0x04a07830 strlen
--1702-- REDIR: 0x3c5f617310 (index) redirected to 0x4a07470 (index)
--1702-- REDIR: 0x3c5f617390 (strcmp) redirected to 0x4a07df0 (strcmp)
--1702-- Reading syms from /lib64/libtinfo.so.5.7 (0x3c70200000)
--1702--    object doesn't have a symbol table
--1702-- Reading syms from /lib64/libdl-2.12.so (0x3c5fa00000)
--1702-- Reading syms from /lib64/libc-2.12.so (0x3c5fe00000)
--1702-- REDIR: 0x3c5fe846b0 (strcasecmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
--1702-- REDIR: 0x3c5fe86970 (strncasecmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
--1702-- REDIR: 0x3c5fe82620 (__GI_strrchr) redirected to 0x4a072f0 (__GI_strrchr)
--1702-- REDIR: 0x3c5fe7f100 (__GI_strcmp) redirected to 0x4a07da0 (__GI_strcmp)
--1702-- REDIR: 0x3c5fe80b40 (__GI_strlen) redirected to 0x4a077f0 (__GI_strlen)
--1702-- REDIR: 0x3c5fe80d70 (__GI_strncmp) redirected to 0x4a07cf0 (__GI_strncmp)
--1702-- REDIR: 0x3c5fe7f040 (__GI_strchr) redirected to 0x4a073b0 (__GI_strchr)
--1702-- REDIR: 0x3c5fe8a4d0 (strchrnul) redirected to 0x4a08f40 (strchrnul)
--1702-- REDIR: 0x3c5fe7a0d0 (malloc) redirected to 0x4a05f10 (malloc)
--1702-- REDIR: 0x3c5fe7af00 (free) redirected to 0x4a05890 (free)
--1702-- REDIR: 0x3c5fe89050 (memcpy) redirected to 0x4a07ec0 (memcpy)
--1702-- REDIR: 0x3c5fe80b00 (strlen) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe80b40 (__GI_strlen         ) R-> 0x04a077d0 strlen
--1702-- REDIR: 0x3c5fe80550 (strcpy) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe80580 (__GI_strcpy         ) R-> 0x04a07850 strcpy
--1702-- REDIR: 0x3c5fe80580 (__GI_strcpy) redirected to 0x4a07920 (__GI_strcpy)
--1702-- REDIR: 0x3c5fe80d30 (strncmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe80d70 (__GI_strncmp        ) R-> 0x04a07c90 strncmp
--1702-- REDIR: 0x3c5fe825f0 (rindex) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe82620 (__GI_strrchr        ) R-> 0x04a072c0 rindex
--1702-- REDIR: 0xffffffffff600400 (???) redirected to 0x38042add (vgPlain_amd64_linux_REDIR_FOR_vtime)
--1702-- REDIR: 0x3c5fe82d30 (memchr) redirected to 0x4a07e90 (memchr)
--1702-- REDIR: 0x3c5fe8a480 (__GI___rawmemchr) redirected to 0x4a08f90 (__GI___rawmemchr)
--1702-- REDIR: 0x3c5fe7f0c0 (strcmp) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe7f100 (__GI_strcmp         ) R-> 0x04a07d50 strcmp
--1702-- REDIR: 0x3c5fe80c20 (strnlen) redirected to 0x4a07770 (strnlen)
--1702-- REDIR: 0x3c5fefeaf0 (__strcpy_chk) redirected to 0x4a097c0 (__strcpy_chk)
--1702-- REDIR: 0x3c5fe7f010 (index) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe7f040 (__GI_strchr         ) R-> 0x04a07380 index
--1702-- REDIR: 0xffffffffff600000 (???) redirected to 0x38042ad3 (vgPlain_amd64_linux_REDIR_FOR_vgettimeofday)
--1702-- REDIR: 0x3c5fe83380 (memset) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
--1702-- REDIR: 0x3c5fe8d950 (__memset_x86_64) redirected to 0x4a08e30 (memset)
--1702-- REDIR: 0x3c5fe7b3f0 (realloc) redirected to 0x4a06030 (realloc)
--1702-- REDIR: 0x3c5fe825c0 (strncpy) redirected to 0x4801560 (_vgnU_ifunc_wrapper)
==1702== WARNING: new redirection conflicts with existing -- ignoring it
--1702--     new: 0x3c5fe8d7c0 (__GI_strncpy        ) R-> 0x04a079f0 strncpy
--1702-- REDIR: 0x3c5fe8d7c0 (__GI_strncpy) redirected to 0x4a07b40 (__GI_strncpy)
==1706== 
==1706== HEAP SUMMARY:
==1706==     in use at exit: 35,860 bytes in 1,023 blocks
==1706==   total heap usage: 2,236 allocs, 1,213 frees, 86,907 bytes allocated
==1706== 
==1706== Searching for pointers to 1,023 not-freed blocks
==1706== Checked 216,096 bytes
==1706== 
==1706== 53 bytes in 1 blocks are definitely lost in loss record 306 of 350
==1706==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==1706==    by 0x465E32: xmalloc (in /bin/bash)
==1706==    by 0x42F7ED: execute_command_internal (in /bin/bash)
==1706==    by 0x430BED: execute_command (in /bin/bash)
==1706==    by 0x432FFA: ??? (in /bin/bash)
==1706==    by 0x42FE9C: execute_command_internal (in /bin/bash)
==1706==    by 0x430BED: execute_command (in /bin/bash)
==1706==    by 0x4315FB: ??? (in /bin/bash)
==1706==    by 0x430024: execute_command_internal (in /bin/bash)
==1706==    by 0x430BED: execute_command (in /bin/bash)
==1706==    by 0x41D535: reader_loop (in /bin/bash)
==1706==    by 0x41CCF8: main (in /bin/bash)
==1706== 
==1706== LEAK SUMMARY:
==1706==    definitely lost: 53 bytes in 1 blocks
==1706==    indirectly lost: 0 bytes in 0 blocks
==1706==      possibly lost: 0 bytes in 0 blocks
==1706==    still reachable: 35,807 bytes in 1,022 blocks
==1706==         suppressed: 0 bytes in 0 blocks
==1706== Reachable blocks (those to which a pointer was found) are not shown.
==1706== To see them, rerun with: --leak-check=full --show-reachable=yes
==1706== 
==1706== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)
--1706-- 
--1706-- used_suppression:      6 dl-hack3-cond-1
==1706== 
==1706== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)
==1708== 
==1708== HEAP SUMMARY:
==1708==     in use at exit: 37,218 bytes in 1,066 blocks
==1708==   total heap usage: 2,378 allocs, 1,312 frees, 92,109 bytes allocated
==1708== 
==1708== Searching for pointers to 1,066 not-freed blocks
==1708== Checked 217,952 bytes
==1708== 
==1708== LEAK SUMMARY:
==1708==    definitely lost: 0 bytes in 0 blocks
==1708==    indirectly lost: 0 bytes in 0 blocks
==1708==      possibly lost: 0 bytes in 0 blocks
==1708==    still reachable: 37,218 bytes in 1,066 blocks
==1708==         suppressed: 0 bytes in 0 blocks
==1708== Reachable blocks (those to which a pointer was found) are not shown.
==1708== To see them, rerun with: --leak-check=full --show-reachable=yes
==1708== 
==1708== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)
--1708-- 
--1708-- used_suppression:      6 dl-hack3-cond-1
==1708== 
==1708== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)
--1702-- REDIR: 0x3c5fe83ee0 (mempcpy) redirected to 0x4a08fb0 (mempcpy)
Started Subsonic [PID 1710, /var/subsonic/subsonic_sh.log]
==1702== 
==1702== HEAP SUMMARY:
==1702==     in use at exit: 41,181 bytes in 976 blocks
==1702==   total heap usage: 2,560 allocs, 1,584 frees, 98,877 bytes allocated
==1702== 
==1702== Searching for pointers to 976 not-freed blocks
==1702== Checked 221,272 bytes
==1702== 
==1702== LEAK SUMMARY:
==1702==    definitely lost: 0 bytes in 0 blocks
==1702==    indirectly lost: 0 bytes in 0 blocks
==1702==      possibly lost: 0 bytes in 0 blocks
==1702==    still reachable: 41,181 bytes in 976 blocks
==1702==         suppressed: 0 bytes in 0 blocks
==1702== Reachable blocks (those to which a pointer was found) are not shown.
==1702== To see them, rerun with: --leak-check=full --show-reachable=yes
==1702== 
==1702== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)
--1702-- 
--1702-- used_suppression:      6 dl-hack3-cond-1
==1702== 
==1702== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)
Tried running the same on ffmpeg itself, but even when running from the /var/subsonic/transcode folder, it can't seem to "find" the ffmpeg executable...

gurutech
Contributor
Contributor
Posts: 323
Joined: 02 Jan 2013, 04:56
Has thanked: 11 times
Been thanked: 105 times

Re: [Bug?] mp3 encoding issue with ffmpeg

Unread post by gurutech »

Posted a possible solution over on SubSonic forum. Basically, it involves adding "mp3" to the transcoding "from" section and saving settings. See attachment...
madsonic.JPG
madsonic.JPG (53.75 KiB) Viewed 2013 times

Post Reply