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 707040 - Segfault in avenc_g722
Segfault in avenc_g722
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 1.1.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-29 11:27 UTC by Fredrik Wigert
Modified: 2013-09-18 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mentioned code (5.24 KB, application/x-zip-compressed)
2013-08-29 11:27 UTC, Fredrik Wigert
Details

Description Fredrik Wigert 2013-08-29 11:27:32 UTC
Created attachment 253488 [details]
Mentioned code

My application is built like this pipeline:
filesrc | decodebin | avenc_g722 | rtpg722pay | udpsink

After playing a file, it goes to GST_STATE_READY, changes location of filesrc and then plays again.

The first play works fine, and but the second results in segfault.

Stacktrace:

Thread [5] 8758 [core: 0] (Suspended : Signal : SIGSEGV:Segmentation fault)	
	gst_ffmpeg_audioinfo_to_context() at gstavcodecmap.c:2,507 0x7ffff3ec6d25	
	gst_ffmpegaudenc_set_format() at gstavaudenc.c:272 0x7ffff3ecb092	
	gst_audio_encoder_sink_setcaps() at gstaudioencoder.c:1,282 0x7ffff53eed8e	
	gst_audio_encoder_chain() at gstaudioencoder.c:1,055 0x7ffff5408589	
	gst_pad_chain_data_unchecked() at gstpad.c:3,711 0x7ffff75f65e0	
	gst_pad_push_data() at gstpad.c:3,941 0x7ffff75f65e0	
	gst_pad_push() at gstpad.c:4,044 0x7ffff75fd0c6	
	gst_proxy_pad_chain_default() at gstghostpad.c:128 0x7ffff75e712b	
	gst_pad_chain_data_unchecked() at gstpad.c:3,711 0x7ffff75f65e0	
	gst_pad_push_data() at gstpad.c:3,941 0x7ffff75f65e0	
	<...more frames...>	


This worked fine in 1.0.9.

Code to my program is attached. To run use the following commands:
setup ip port bind-port payload payload-as-string
play file
play file
Comment 1 Fredrik Wigert 2013-08-29 12:10:09 UTC
I just tried running it with libav 1.0 branch, rest branch. It worked fine then.
Comment 2 Sebastian Dröge (slomo) 2013-08-29 13:54:21 UTC
Yes, from looking at the code it must crash ;)
Comment 3 Sebastian Dröge (slomo) 2013-08-29 14:55:20 UTC
This should fix it:

commit 6571196fb87394dfbb3f090cb5442c8c30283bf0
Author: Sebastian Dröge <slomo@circular-chaos.org>
Date:   Thu Aug 29 16:53:28 2013 +0200

    libav: avcodec_close() also resets fields like the AVCodec
    
    We need to reload the defaults for the codec after closing it,
    otherwise we can't access codec information like the supported
    sample rates and can crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707040