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 710394 - call to g_source_add_child_source() triggers a segfault
call to g_source_add_child_source() triggers a segfault
Status: RESOLVED DUPLICATE of bug 701283
Product: glib
Classification: Platform
Component: mainloop
2.36.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-10-17 14:09 UTC by Ognyan Tonchev (redstar_)
Modified: 2013-10-17 14:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ognyan Tonchev (redstar_) 2013-10-17 14:09:44 UTC
calling g_source_add_child_source(parentsrc, childsrc) causes a segfault in block_source(childsrc) when childsrc has at least one child source and parentsrc happens to be blocked at the time.

In my case the code that triggers the segfault looks like:

    writesrc =
        g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
        (watch->conn->output_stream), NULL);
    g_source_set_callback (writesrc,
        (GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
    g_source_add_child_source ((GSource *) watch, writesrc);

And the backtrace:

  • #0 g_main_context_remove_poll_unlocked
    at /mnt/ssd/branko/trees/p3367_ib_20130911/unpacked/libs/glib-9b007c95aa9035ad887765605ebfbe4dce3c5139/glib/glib/gmain.c line 4155
  • #1 block_source
    at /mnt/ssd/branko/trees/p3367_ib_20130911/unpacked/libs/glib-9b007c95aa9035ad887765605ebfbe4dce3c5139/glib/glib/gmain.c line 2943
  • #2 block_source
    at /mnt/ssd/branko/trees/p3367_ib_20130911/unpacked/libs/glib-9b007c95aa9035ad887765605ebfbe4dce3c5139/glib/glib/gmain.c line 2955
  • #3 g_source_add_child_source
    at /mnt/ssd/branko/trees/p3367_ib_20130911/unpacked/libs/glib-9b007c95aa9035ad887765605ebfbe4dce3c5139/glib/glib/gmain.c line 1423
  • #4 gst_rtsp_watch_write_data
I see the failure in glib 3.26 but i don't think that has changed on git master.
Comment 1 Dan Winship 2013-10-17 14:36:20 UTC
this is fixed in 2.38 actually

*** This bug has been marked as a duplicate of bug 701283 ***