Opened 11 years ago

Closed 11 years ago

#1892 closed defect (fixed)

smackaud: huge memory allocation

Reported by: ami_stuff Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: smacker leak crash SIGSEGV
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

http://samples.mplayerhq.hu/A-codecs/MACE/Bach1-1.aiff

C:\>ffmpeg -acodec smackaud -i Bach1-1.aiff -f null -
ffmpeg version N-46283-g1475815 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  2 2012 02:31:20 with gcc 4.5.0 (GCC) 20100414 (Fedora MinGW 4.5.
0-1.fc14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm -lpthread' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snap
shots/build/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/s
napshots/build/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3
--enable-nonfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-
libvorbis --enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 70.100 / 54. 70.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[aiff @ 0x1edc400] max_analyze_duration 5000000 reached at 5153590
Input #0, aiff, from 'Bach1-1.aiff':
  Metadata:
    title           : No name specified
    author          : No author specified
    copyright       : No copyright specified
  Duration: 00:00:11.55, start: 0.000000, bitrate: 178 kb/s
    Stream #0:0: Audio: smackaudio, 22254 Hz, mono, u8, 178 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    title           : No name specified
    author          : No author specified
    copyright       : No copyright specified
    encoder         : Lavf54.35.100
    Stream #0:0: Audio: pcm_s16le, 22254 Hz, mono, s16, 356 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (smackaud -> pcm_s16le)
Press [q] to stop, [?] for help
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
Multiple frames in a packet from stream 0
[smackaud @ 0x1edcc40] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
    Last message repeated 3 times
[smackaud @ 0x1edcc40] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] get_buffer() failed
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
    Last message repeated 2 times
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] Sound: no data
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
get_buffer() failede=00:12:39.06 bitrate=   0.0kbits/s
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[smackaud @ 0x1edcc40] channels mismatch
Error while decoding stream #0:0: Error number -22 occurred
[pcm_s16le @ 0x1edf080] Failed to allocate packet of size 270147124
Audio encoding failed (avcodec_encode_audio2)

Change History (5)

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavcodec
Keywords: smacker leak added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master
$ valgrind ./ffmpeg_g -acodec smackaud -i Bach1-1.aiff -f null -
==6166== Memcheck, a memory error detector
==6166== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==6166== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==6166== Command: ./ffmpeg_g -acodec smackaud -i Bach1-1.aiff -f null -
==6166==
ffmpeg version N-46501-g29d46d7 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov  6 2012 23:16:24 with gcc 4.7 (SUSE Linux)
  configuration: --disable-indev=jack --enable-gpl --enable-libvorbis
  libavutil      52.  5.100 / 52.  5.100
  libavcodec     54. 71.100 / 54. 71.100
  libavformat    54. 36.100 / 54. 36.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 21.106 /  3. 21.106
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[aiff @ 0x6fb6de0] max_analyze_duration 5000000 reached at 5153590
Input #0, aiff, from 'Bach1-1.aiff':
  Metadata:
    title           : No name specified
    author          : No author specified
    copyright       : No copyright specified
  Duration: 00:00:11.55, start: 0.000000, bitrate: 178 kb/s
    Stream #0:0: Audio: smackaudio, 22254 Hz, mono, u8, 178 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    title           : No name specified
    author          : No author specified
    copyright       : No copyright specified
    encoder         : Lavf54.36.100
    Stream #0:0: Audio: pcm_s16le, 22254 Hz, mono, s16, 356 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (smackaud -> pcm_s16le)
Press [q] to stop, [?] for help
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
Multiple frames in a packet from stream 0
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 3 times
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 2 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:12:39.06 bitrate=   0.0kbits/s    ^Mget_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
==6166== Warning: set address range perms: large range [0x3943e080, 0x59781d00) (undefined)
==6166== Warning: set address range perms: large range [0x217f5080, 0x329b10c8) (undefined)
==6166== Warning: set address range perms: large range [0x59782080, 0x69923ec4) (undefined)
==6166== Warning: set address range perms: large range [0x59782070, 0x69923ed4) (noaccess)
==6166== Warning: set address range perms: large range [0x3943e070, 0x59781d10) (noaccess)
Error while decoding stream #0:0: Operation not permitted
size=       0kB time=01:41:12.94 bitrate=   0.0kbits/s    ^MSound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 2 times
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:13:17.53 bitrate=   0.0kbits/s
Sound: no data
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:25:19.04 bitrate=   0.0kbits/s
channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 10 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 7 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 54 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
length too long
[smackaud @ 0x6fcdf00] invalid vlc
Error while decoding stream #0:0: Invalid data found when processing input
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 3 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 2 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 3 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 2 times
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
==6166== Warning: set address range perms: large range [0x3943e080, 0x5157f3a0) (undefined)
    Last message repeated 1 times
Error while decoding stream #0:0: Operation not permitted
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:25:19.04 bitrate=   0.0kbits/s    ^MSound: no data
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
Error while decoding stream #0:0: Operation not permitted
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 2 times
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] Sound: no data
    Last message repeated 1 times
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] channels mismatch
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] get_buffer() failed
Error while decoding stream #0:0: Invalid argument
[smackaud @ 0x6fcdf00] sample format mismatch
Error while decoding stream #0:0: Invalid argument
size=       0kB time=00:12:45.30 bitrate=   0.0kbits/s    ^Msize=       0kB time=00:12:45.30 bitrate=   0.0kbits/s    ^M
video:0kB audio:429722kB subtitle:0 global headers:0kB muxing overhead -100.000000%
==6166== Warning: set address range perms: large range [0x217f5070, 0x329b10d8) (noaccess)
==6166== Warning: set address range perms: large range [0x3943e070, 0x5157f3b0) (noaccess)
==6166==
==6166== HEAP SUMMARY:
==6166==     in use at exit: 26,624 bytes in 16 blocks
==6166==   total heap usage: 599 allocs, 583 frees, 2,671,640,631 bytes allocated
==6166==
==6166== LEAK SUMMARY:
==6166==    definitely lost: 26,624 bytes in 16 blocks
==6166==    indirectly lost: 0 bytes in 0 blocks
==6166==      possibly lost: 0 bytes in 0 blocks
==6166==    still reachable: 0 bytes in 0 blocks
==6166==         suppressed: 0 bytes in 0 blocks
==6166== Rerun with --leak-check=full to see details of leaked memory
==6166==
==6166== For counts of detected and suppressed errors, rerun with: -v
==6166== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

comment:2 by ami_stuff, 11 years ago

after blocking the mem request I get similar crash like in ticket #1376

I wonder if this reproducible.

(gdb) r -cpuflags 0 -acodec smackaud -i Bach1-1.aiff -f null -
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: d:\mingw\msys\1.0\ffmpeg-head-b2b67fd\ffmpeg_g.exe -cpuflags 0
 -acodec smackaud -i Bach1-1.aiff -f null -
[New Thread 1600.0x644]

Program received signal SIGSEGV, Segmentation fault.
0x004214f5 in avfilter_copy_buffer_ref_props (dst=0x0, src=0x4890160)
    at libavfilter/buffer.c:192
192         dst->pts             = src->pts;
(gdb) bt
#0  0x004214f5 in avfilter_copy_buffer_ref_props (dst=0x0, src=0x4890160)
    at libavfilter/buffer.c:192
#1  0x00428144 in filter_samples (inlink=0x47a6fe0, insamplesref=0x4890160)
    at libavfilter/af_aresample.c:183
#2  0x0042523e in ff_filter_samples_framed (link=0x47a6fe0,
    samplesref=0x4890160) at libavfilter/audio.c:216
#3  0x0042523e in ff_filter_samples_framed (link=0x47a6a40,
    samplesref=0x4890160) at libavfilter/audio.c:216
#4  0x00421d04 in request_frame (link=0x47a6a40)
    at libavfilter/buffersrc.c:383
#5  0x00421f1a in av_buffersrc_add_ref (s=0x48b2c60, buf=0x4890160, flags=4)
    at libavfilter/buffersrc.c:151
#6  0x004220ac in av_buffersrc_add_frame (buffer_src=0x48b2c60,
    frame=0x47aa4e0, flags=4) at libavfilter/buffersrc.c:90
#7  0x0040ff23 in decode_audio (got_output=<optimized out>,
    pkt=<optimized out>, ist=<optimized out>) at ffmpeg.c:1539
#8  output_packet (ist=0x47ad740, pkt=0x22fb48) at ffmpeg.c:1759
#9  0x004114e8 in process_input (file_index=<optimized out>) at ffmpeg.c:2826
#10 0x00b37efe in transcode_step () at ffmpeg.c:2922
#11 transcode () at ffmpeg.c:2974
#12 main (argc=76228480, argv=<optimized out>) at ffmpeg.c:3158
(gdb)

comment:3 by Carl Eugen Hoyos, 11 years ago

I can reproduce the crash with "ulimit -Sv 500000"

comment:4 by Carl Eugen Hoyos, 11 years ago

Keywords: crash SIGSEGV added
Priority: normalimportant

comment:5 by Michael Niedermayer, 11 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.