After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 403168 - [ffmux_flv] crash on buffer after returning FLOW_ERROR previously
[ffmux_flv] crash on buffer after returning FLOW_ERROR previously
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal major
: 0.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-01 11:06 UTC by Sebastien Merle
Modified: 2007-02-09 17:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastien Merle 2007-02-01 11:06:20 UTC
If executed enough, the following command fails with different errors:
 
gst-launch audiotestsrc ! audio/x-raw-int,rate=44100 ! audioconvert ! audioresample ! audio/x-raw-int,rate=24000 ! lame ! mp3parse ! ffmux_flv ! fakesink

The specified rate is not supported by ffmux_flv so gst-lauch shutdown the pipeline, and during the audioresample shutdown the following errors append:
- Floating point exception
- Segmentation fault 
- Deadlock
Comment 1 Sebastien Merle 2007-02-01 11:10:22 UTC
Double free append too.
Comment 2 Sebastian Dröge (slomo) 2007-02-01 12:39:20 UTC
I can't reproduce this here with latest CVS. Which versions of gstreamer, gst-plugins-base, gst-plugins-ugly and gst-ffmpeg do you have?


LC_ALL=C gst-launch audiotestsrc ! audio/x-raw-int,rate=44100 ! audioconvert ! audioresample ! audio/x-raw-int,rate=24000 ! lame ! mp3parse ! ffmux_flv ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.727415000 15849 0x806ebb0 ERROR               ffmpeg :0:: flv doesnt support that sample rate, choose from (44100, 22050, 11025)

ERROR: from element /pipeline0/ffmux_flv0: Could not configure supporting library.
Additional debug info:
gstffmpegmux.c(475): gst_ffmpegmux_collected (): /pipeline0/ffmux_flv0:
Failed to write file header - check codec settings
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
FREEING pipeline ...
Comment 3 Tim-Philipp Müller 2007-02-01 12:48:05 UTC
I get a crash about 1 out of 20 times with current CVS of things. Unfortunately I can't reproduce it under valgrind.
Comment 4 Sebastian Dröge (slomo) 2007-02-01 12:54:57 UTC
Hmm, I got a segfault now with a supported sample rate and ctrl+c and can reproduce this almost always... interesting

Let's set this to confirmed then...
Comment 5 Sebastien Merle 2007-02-01 13:31:08 UTC
I'm using the HEAD version of all.

Following are some backtraces I got. 
Note that these are not from the gst-lauch command I give before but from my application that do little more (have a tee and a queue).
All the following error append during the pipeline shutdown.


Segmentation Fault Backtraces:
------------------------------

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 4691)

  • #0 malloc_usable_size
    from /lib/tls/i686/cmov/libc.so.6
  • #1 mallopt
    from /lib/tls/i686/cmov/libc.so.6
  • #2 free
    from /lib/tls/i686/cmov/libc.so.6
  • #3 resample_free
    at resample.c line 89
  • #4 audioresample_stop
    at gstaudioresample.c line 222
  • #5 gst_base_transform_activate
    at gstbasetransform.c line 1639
  • #6 gst_base_transform_sink_activate_push
    at gstbasetransform.c line 1653
  • #7 gst_pad_activate_push
    at gstpad.c line 866
  • #8 gst_pad_set_active
    at gstpad.c line 652
  • #9 activate_pads
    at gstelement.c line 2354
  • #10 gst_iterator_fold
    at gstiterator.c line 503
  • #11 iterator_activate_fold_with_resync
    at gstelement.c line 2386
  • #12 gst_element_pads_activate
    at gstelement.c line 2429
  • #13 gst_element_change_state_func
    at gstelement.c line 2506
  • #14 gst_element_change_state
    at gstelement.c line 2275
  • #15 gst_element_set_state_func
    at gstelement.c line 2236
  • #16 gst_element_set_state
    at gstelement.c line 2144
  • #17 gst_bin_change_state_func
    at gstbin.c line 1767
  • #18 gst_element_change_state
    at gstelement.c line 2275
  • #19 gst_element_set_state_func
    at gstelement.c line 2236
  • #20 gst_element_set_state
    at gstelement.c line 2144
  • #21 gst_bin_change_state_func
    at gstbin.c line 1767
  • #22 gst_element_change_state
    at gstelement.c line 2275
  • #23 gst_element_set_state_func
    at gstelement.c line 2236
  • #24 gst_element_set_state
    at gstelement.c line 2144
  • #25 gst_bin_change_state_func
    at gstbin.c line 1767
  • #26 gst_pipeline_change_state
    at gstpipeline.c line 490
  • #27 gst_element_change_state
    at gstelement.c line 2275
  • #28 gst_element_set_state_func
    at gstelement.c line 2236
  • #29 gst_element_set_state
    at gstelement.c line 2144

Thread NaN (LWP 5033)

  • #0 resample_scale_ref
    at resample_ref.c line 156
  • #1 resample_get_output_data
    at resample.c line 244
  • #2 audioresample_do_output
    at gstaudioresample.c line 512
  • #3 gst_base_transform_handle_buffer
    at gstbasetransform.c line 1453
  • #4 gst_base_transform_chain
    at gstbasetransform.c line 1547
  • #5 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #6 gst_pad_push
    at gstpad.c line 3583
  • #7 gst_audio_rate_chain
    at gstaudiorate.c line 645
  • #8 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #9 gst_pad_push
    at gstpad.c line 3583
  • #10 gst_base_transform_chain
    at gstbasetransform.c line 1553
  • #11 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #12 gst_pad_push
    at gstpad.c line 3583
  • #13 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #14 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #15 gst_pad_push
    at gstpad.c line 3583
  • #16 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #17 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #18 gst_pad_push
    at gstpad.c line 3583
  • #19 gst_tee_do_push
    at gsttee.c line 374
  • #20 gst_iterator_fold
    at gstiterator.c line 503
  • #21 gst_tee_handle_buffer
    at gsttee.c line 412
  • #22 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #23 gst_pad_push
    at gstpad.c line 3583
  • #24 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #25 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #26 gst_pad_push
    at gstpad.c line 3583
  • #27 vorbis_dec_decode_buffer
    at vorbisdec.c line 902
  • #28 vorbis_dec_chain
    at vorbisdec.c line 1322
  • #29 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #30 gst_pad_push
    at gstpad.c line 3583
  • #31 gst_queue_loop
    at gstqueue.c line 810
  • #32 gst_task_func
    at gsttask.c line 192
  • #33 g_thread_pool_push
    from /usr/lib/libglib-2.0.so.0
  • #34 g_thread_create_full
    from /usr/lib/libglib-2.0.so.0
  • #35 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #36 clone
    from /lib/tls/i686/cmov/libc.so.6

Thread NaN (LWP 4773)

  • #0 memcpy
    from /lib/tls/i686/cmov/libc.so.6
  • #1 resample_scale_ref
    at resample_ref.c line 129
  • #2 resample_get_output_data
    at resample.c line 244
  • #3 audioresample_do_output
    at gstaudioresample.c line 512
  • #4 gst_base_transform_handle_buffer
    at gstbasetransform.c line 1453
  • #5 gst_base_transform_chain
    at gstbasetransform.c line 1547
  • #6 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #7 gst_pad_push
    at gstpad.c line 3583
  • #8 gst_audio_rate_chain
    at gstaudiorate.c line 645
  • #9 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #10 gst_pad_push
    at gstpad.c line 3583
  • #11 gst_base_transform_chain
    at gstbasetransform.c line 1553
  • #12 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #13 gst_pad_push
    at gstpad.c line 3583
  • #14 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #15 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #16 gst_pad_push
    at gstpad.c line 3583
  • #17 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #18 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #19 gst_pad_push
    at gstpad.c line 3583
  • #20 gst_tee_do_push
    at gsttee.c line 374
  • #21 gst_iterator_fold
    at gstiterator.c line 503
  • #22 gst_tee_handle_buffer
    at gsttee.c line 412
  • #23 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #24 gst_pad_push
    at gstpad.c line 3583
  • #25 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #26 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #27 gst_pad_push
    at gstpad.c line 3583
  • #28 vorbis_dec_decode_buffer
    at vorbisdec.c line 902
  • #29 vorbis_dec_chain
    at vorbisdec.c line 1322
  • #30 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #31 gst_pad_push
    at gstpad.c line 3583
  • #32 gst_queue_loop
    at gstqueue.c line 810
  • #33 gst_task_func
    at gsttask.c line 192
  • #34 g_thread_pool_push
    from /usr/lib/libglib-2.0.so.0
  • #35 g_thread_create_full
    from /usr/lib/libglib-2.0.so.0
  • #36 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #37 clone
    from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread -1222952032 (LWP 4897))

  • #0 g_list_first
    from /usr/lib/libglib-2.0.so.0
  • #1 audioresample_buffer_queue_pull
    at buffer.c line 156
  • #2 resample_scale_ref
    at resample_ref.c line 113
  • #3 resample_get_output_data
    at resample.c line 244
  • #4 audioresample_do_output
    at gstaudioresample.c line 512
  • #5 gst_base_transform_handle_buffer
    at gstbasetransform.c line 1453
  • #6 gst_base_transform_chain
    at gstbasetransform.c line 1547
  • #7 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #8 gst_pad_push
    at gstpad.c line 3583
  • #9 gst_audio_rate_chain
    at gstaudiorate.c line 645
  • #10 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #11 gst_pad_push
    at gstpad.c line 3583
  • #12 gst_base_transform_chain
    at gstbasetransform.c line 1553
  • #13 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #14 gst_pad_push
    at gstpad.c line 3583
  • #15 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #16 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #17 gst_pad_push
    at gstpad.c line 3583
  • #18 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #19 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #20 gst_pad_push
    at gstpad.c line 3583
  • #21 gst_tee_do_push
    at gsttee.c line 374
  • #22 gst_iterator_fold
    at gstiterator.c line 503
  • #23 gst_tee_handle_buffer
    at gsttee.c line 412
  • #24 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #25 gst_pad_push
    at gstpad.c line 3583
  • #26 gst_proxy_pad_do_chain
    at gstghostpad.c line 191
  • #27 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #28 gst_pad_push
    at gstpad.c line 3583
  • #29 vorbis_dec_decode_buffer
    at vorbisdec.c line 902
  • #30 vorbis_dec_chain
    at vorbisdec.c line 1322
  • #31 gst_pad_chain_unchecked
    at gstpad.c line 3417
  • #32 gst_pad_push
    at gstpad.c line 3583
  • #33 gst_queue_loop
    at gstqueue.c line 810
  • #34 gst_task_func
    at gsttask.c line 192
  • #35 g_thread_pool_push
    from /usr/lib/libglib-2.0.so.0
  • #36 g_thread_create_full
    from /usr/lib/libglib-2.0.so.0
  • #37 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #38 clone
    from /lib/tls/i686/cmov/libc.so.6


Comment 6 Tim-Philipp Müller 2007-02-09 17:37:49 UTC
This is fixed for me now, with the following commits:

 2007-02-09  Tim-Philipp Müller  <tim at centricular dot net>

        * ext/lame/gstlame.c: (gst_lame_sink_event), (gst_lame_chain),
        (gst_lame_change_state):
        * ext/lame/gstlame.h:
          On receiving EOS, we try to push a last buffer with the remaining
          samples. Don't do that if we got an unclean flow return on the last
          gst_pad_push(), downstream might not handle this very gracefully
          (see #403168).

        * gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_chain):
          Pass flow returns upstream (helps #403168).

 2007-02-09  Tim-Philipp Müller  <tim at centricular dot net>

        * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_request_new_pad),
        (gst_ffmpegmux_setcaps), (gst_ffmpegmux_collected):
          Only set the mux->opened flag after we've successfully written the
          header. This way we don't crash in mysterious ways if we can't write
          the header for some reason (e.g. due to having accepted caps the
          format doesn't really allow), then return a GST_FLOW_ERROR, and
          then still receive another buffer afterwards despite having previously
          returned FLOW_ERROR (#403168).
          Also some minor logging improvements.

 2007-02-09  Tim-Philipp Müller  <tim at centricular dot net>
 
       * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_register):
         ffmux_flv only accepts mpeg audio with a sample rate of 44100, 22050
         or 11025. Fix up the caps in the sink pad template accordingly, so
         that encoding piplines at least have a chance to automatically
         negotiate to one of the allowed rates.

Primarily an ffmux_flv bug I think, no idea why it crashes in audioresample for you (may thrashed memory). Please re-open if you still get the crash with CVS HEAD of everything (including core).