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 663555 - segfault removing a stream with a connected client
segfault removing a stream with a connected client
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-07 12:54 UTC by Nicola
Modified: 2014-02-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that avoid segfault (1.32 KB, patch)
2011-11-07 15:48 UTC, Nicola
rejected Details | Review

Description Nicola 2011-11-07 12:54:59 UTC
Here is the segfault

  • #0 __GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 __GI_abort
    at abort.c line 92
  • #2 __libc_message
    at ../sysdeps/unix/sysv/linux/libc_fatal.c line 189
  • #3 malloc_printerr
  • #4 __GI___libc_free
    at malloc.c line 3738
  • #5 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #6 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #7 media_unprepared
    at rtsp-media-factory.c line 572
  • #8 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #9 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #12 gst_rtsp_media_unprepare
    at rtsp-media.c line 1854
  • #13 gst_rtsp_media_unprepare
    at rtsp-media.c line 1832
  • #14 gst_rtsp_media_set_state
    at rtsp-media.c line 2024
  • #15 handle_teardown_request
    at rtsp-client.c line 540
  • #16 handle_request
    at rtsp-client.c line 1377
  • #17 message_received
    at rtsp-client.c line 1660
  • #18 gst_rtsp_source_dispatch
    at gstrtspconnection.c line 3189
  • #19 g_main_context_dispatch

and here is the code:

GstRTSPMediaMapping *mapping;
mapping=gst_rtsp_server_get_media_mapping(rtspserver);
gst_rtsp_media_mapping_remove_factory(mapping,streamurl.constData());
g_object_unref(mapping);

gst-rtsp-server crash if I remove a media_mapping and a client is still connected
Comment 1 Nicola 2011-11-07 15:48:51 UTC
Created attachment 200896 [details] [review]
Patch that avoid segfault

Probably is not the best solution but this way gst-rtsp-server works without segfault, please note that with this patch an "Invalid read of size 8" valgrind warning is given on the first null check if media_unprepared is called on an already finalized media
Comment 2 Wim Taymans 2012-11-20 11:31:37 UTC
commit 37a7ec8033511cc8950047daad7e28953b9f5fe9
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Tue Nov 20 12:29:55 2012 +0100

    factory: keep ref to factory while media active
    
    While the media from a factory is alive, keep a ref to the factory.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=663555