[gst 1.2.2] remove a request pad from videomixer cause SEGFAULT

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[gst 1.2.2] remove a request pad from videomixer cause SEGFAULT

Lautaro Woites
Hi again folks,

I have this pipe: videotestsrc ! capsfilter ! videomixer ! xvimagesink.
Then on PLAYING STATE I do:

while (TRUE){
    sleep(2);
    add_mixer_input(); //adds an input on the videomixer
    sleep(2);
    remove_mixer_input(); //removes the previously added input to the mixer.
}

The inputs are bins with videotestsrc and a capsfilter. The example runs for a time (sometimes 5 minutes, sometimes 30 min, others 10 seconds) and then produces a segmentation fault on the videomixer (at gst_collect_pads_check_collected:1031).

This is what I do to remove the input:
     a) I  block the videotestsrc's src pad.
     b) I send an EOS event to the capsfilter's sink pad and I wait for the event on the bin's src pad ( with an event probe).
     c) On the  event probe's callback I drop the EOS and I unlink the bin with the mixer.
     d) I set the bin to STATE_NULL and I remove it from the pipe.
     e) I call release_request_pad on the mixer.
     f) I remove the block pad on the videotestsrc.
Also I've tried: to send EOS to the videtestsrc - set the bin to STATE_NULL and remove it - and finally call release_request_pad on the mixer.
The program  crashed in the same line .

NOTE:   If I remove the call to gst_release_request_pad the program seems to work OK. But the mixer's will still having unused sink pads :(.

I have some question about this:
   1) I don't know if I am missing something or if there is a bug.
   2) If I'm doing something wrong, What's the correct/safest  protocol to remove an input from the mixer?.
   3) is it related with this ticket: https://bugzilla.gnome.org/show_bug.cgi?id=701110 ?


I've attached an example program. In my PC if I want to blow up the program faster I ran it with GST_DEBUG=4.



The complete backtrace is:
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007f64932efc90 in ?? () from /usr/lib/gstreamer-1.0/libgstvideomixer.so
#2  0x00007f64932f0ca1 in ?? () from /usr/lib/gstreamer-1.0/libgstvideomixer.so
#3  0x00007f6493e285f7 in gst_collect_pads_check_collected (pads=pads@entry=0x105d0d0) at gstcollectpads.c:1301
#4  0x00007f6493e29a88 in gst_collect_pads_chain (pad=0x106a040, parent=<optimized out>, buffer=0x106cbe0) at gstcollectpads.c:2023
#5  0x00007f6495b87d78 in gst_pad_chain_data_unchecked (data=0x106cbe0, type=4112, pad=0x106a040) at gstpad.c:3711
#6  gst_pad_push_data (pad=0x104a960, type=type@entry=4112, data=<optimized out>) at gstpad.c:3941
#7  0x00007f6495b8e8c6 in gst_pad_push (pad=<optimized out>, buffer=<optimized out>) at gstpad.c:4044
#8  0x00007f6493e220b9 in gst_base_transform_chain (pad=<optimized out>, parent=0x10573d0, buffer=<optimized out>) at gstbasetransform.c:2237
#9  0x00007f6495b87d78 in gst_pad_chain_data_unchecked (data=0x106cbe0, type=4112, pad=0x104a730) at gstpad.c:3711
#10 gst_pad_push_data (pad=0x104a500, type=type@entry=4112, data=<optimized out>) at gstpad.c:3941
#11 0x00007f6495b8e8c6 in gst_pad_push (pad=<optimized out>, buffer=<optimized out>) at gstpad.c:4044
#12 0x00007f6493e220b9 in gst_base_transform_chain (pad=<optimized out>, parent=0x10500f0, buffer=<optimized out>) at gstbasetransform.c:2237
#13 0x00007f6495b87d78 in gst_pad_chain_data_unchecked (data=0x106cbe0, type=4112, pad=0x104a2d0) at gstpad.c:3711
#14 gst_pad_push_data (pad=pad@entry=0x104a0a0, type=type@entry=4112, data=<optimized out>) at gstpad.c:3941
#15 0x00007f6495b8e8c6 in gst_pad_push (pad=pad@entry=0x104a0a0, buffer=<optimized out>) at gstpad.c:4044
#16 0x00007f6493e1a515 in gst_base_src_loop (pad=0x104a0a0) at gstbasesrc.c:2779
#17 0x00007f6495bb5439 in gst_task_func (task=0x1079050) at gsttask.c:316
#18 0x00007f6495643976 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007f6495642fb5 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x00007f64953c10a2 in start_thread () from /usr/lib/libpthread.so.0
#21 0x00007f64950f432d in clone () from /usr/lib/libc.so.6

Thanks again

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gst 1.2.2] remove a request pad from videomixer cause SEGFAULT

Sebastian Dröge-3
On Mi, 2014-01-22 at 17:51 -0200, Lautaro Woites wrote:

> Hi again folks,
>
> I have this pipe: videotestsrc ! capsfilter ! videomixer ! xvimagesink.
> Then on PLAYING STATE I do:
>
> while (TRUE){
>     sleep(2);
>     add_mixer_input(); //adds an input on the videomixer
>     sleep(2);
>     remove_mixer_input(); //removes the previously added input to the mixer.
> }
>
> The inputs are bins with videotestsrc and a capsfilter. The example runs
> for a time (sometimes 5 minutes, sometimes 30 min, others 10 seconds) and
> then produces a segmentation fault on the videomixer (at
> gst_collect_pads_check_collected:1031).
>
> This is what I do to remove the input:
>      a) I  block the videotestsrc's src pad.
>      b) I send an EOS event to the capsfilter's sink pad and I wait for the
> event on the bin's src pad ( with an event probe).
>      c) On the  event probe's callback I drop the EOS and I unlink the bin
> with the mixer.
>      d) I set the bin to STATE_NULL and I remove it from the pipe.
>      e) I call release_request_pad on the mixer.
>      f) I remove the block pad on the videotestsrc.
> Also I've tried: to send EOS to the videtestsrc - set the bin to STATE_NULL
> and remove it - and finally call release_request_pad on the mixer.
> The program  crashed in the same line .
>
> NOTE:   If I remove the call to gst_release_request_pad the program seems
> to work OK. But the mixer's will still having unused sink pads :(.
The sequence of actions sounds correct

> I have some question about this:
>    1) I don't know if I am missing something or if there is a bug.
>    2) If I'm doing something wrong, What's the correct/safest  protocol to
> remove an input from the mixer?.
>    3) is it related with this ticket:
> https://bugzilla.gnome.org/show_bug.cgi?id=701110 ?

It might indeed be this bug, but then it wouldn't happen always. Could
you attach a testcase to that bug that reproduces the crash? What you're
doing is supposed to work and definitely should not crash.

--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gst 1.2.2] remove a request pad from videomixer cause SEGFAULT

Lautaro Woites



2014/1/23 Sebastian Dröge <[hidden email]>
On Mi, 2014-01-22 at 17:51 -0200, Lautaro Woites wrote:
> Hi again folks,
>
> I have this pipe: videotestsrc ! capsfilter ! videomixer ! xvimagesink.
> Then on PLAYING STATE I do:
>
> while (TRUE){
>     sleep(2);
>     add_mixer_input(); //adds an input on the videomixer
>     sleep(2);
>     remove_mixer_input(); //removes the previously added input to the mixer.
> }
>
> The inputs are bins with videotestsrc and a capsfilter. The example runs
> for a time (sometimes 5 minutes, sometimes 30 min, others 10 seconds) and
> then produces a segmentation fault on the videomixer (at
> gst_collect_pads_check_collected:1031).
>
> This is what I do to remove the input:
>      a) I  block the videotestsrc's src pad.
>      b) I send an EOS event to the capsfilter's sink pad and I wait for the
> event on the bin's src pad ( with an event probe).
>      c) On the  event probe's callback I drop the EOS and I unlink the bin
> with the mixer.
>      d) I set the bin to STATE_NULL and I remove it from the pipe.
>      e) I call release_request_pad on the mixer.
>      f) I remove the block pad on the videotestsrc.
> Also I've tried: to send EOS to the videtestsrc - set the bin to STATE_NULL
> and remove it - and finally call release_request_pad on the mixer.
> The program  crashed in the same line .
>
> NOTE:   If I remove the call to gst_release_request_pad the program seems
> to work OK. But the mixer's will still having unused sink pads :(.

The sequence of actions sounds correct

> I have some question about this:
>    1) I don't know if I am missing something or if there is a bug.
>    2) If I'm doing something wrong, What's the correct/safest  protocol to
> remove an input from the mixer?.
>    3) is it related with this ticket:
> https://bugzilla.gnome.org/show_bug.cgi?id=701110 ?

It might indeed be this bug, but then it wouldn't happen always. Could
you attach a testcase to that bug that reproduces the crash? What you're
doing is supposed to work and definitely should not crash.


OK I've attached an example to the ticket.

Hope it helps. If you need more info just tell me.
 
--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gst 1.2.2] remove a request pad from videomixer cause SEGFAULT

Lautaro Woites
The backtrace in the previous mail was obtained by running the example with the arch linux binaries.
Now, I'm  running the example with a gst-uninstalled setup and the program blows up also on videomixer but in another place.



 I've forgotten to attach the example on the previous mail. I'am attaching it now.

Here's the backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x00007f1214bb4c60 in gst_videomixer2_blend_buffers (mix=mix@entry=0x13ea0f0, output_start_time=output_start_time@entry=224680000000, output_end_time=output_end_time@entry=224720000000,
    outbuf=outbuf@entry=0x7f1212dea938) at videomixer2.c:1039
#2  0x00007f1214bb5c40 in gst_videomixer2_collected (pads=<optimized out>, mix=0x13ea0f0) at videomixer2.c:1276
#3  0x00007f12156ec507 in gst_collect_pads_check_collected (pads=pads@entry=0x13ec160) at gstcollectpads.c:1301
#4  0x00007f12156ed998 in gst_collect_pads_chain (pad=0x14020e0, parent=<optimized out>, buffer=0x1404c80) at gstcollectpads.c:2023
#5  0x00007f121744bb98 in gst_pad_chain_data_unchecked (data=0x1404c80, type=4112, pad=0x14020e0) at gstpad.c:3711
#6  gst_pad_push_data (pad=0x13da900, type=type@entry=4112, data=<optimized out>) at gstpad.c:3941
#7  0x00007f12174526e6 in gst_pad_push (pad=<optimized out>, buffer=<optimized out>) at gstpad.c:4044
#8  0x00007f12156e5e29 in gst_base_transform_chain (pad=<optimized out>, parent=0x13e5b30, buffer=<optimized out>) at gstbasetransform.c:2237
#9  0x00007f121744bb98 in gst_pad_chain_data_unchecked (data=0x1404c80, type=4112, pad=0x13da6d0) at gstpad.c:3711
#10 gst_pad_push_data (pad=0x13da4a0, type=type@entry=4112, data=<optimized out>) at gstpad.c:3941
#11 0x00007f12174526e6 in gst_pad_push (pad=<optimized out>, buffer=<optimized out>) at gstpad.c:4044
#12 0x00007f12156e5e29 in gst_base_transform_chain (pad=<optimized out>, parent=0x13de150, buffer=<optimized out>) at gstbasetransform.c:2237
#13 0x00007f121744bb98 in gst_pad_chain_data_unchecked (data=0x1404c80, type=4112, pad=0x13da270) at gstpad.c:3711
#14 gst_pad_push_data (pad=pad@entry=0x13da040, type=type@entry=4112, data=<optimized out>) at gstpad.c:3941
#15 0x00007f12174526e6 in gst_pad_push (pad=pad@entry=0x13da040, buffer=<optimized out>) at gstpad.c:4044
#16 0x00007f12156de285 in gst_base_src_loop (pad=0x13da040) at gstbasesrc.c:2779
#17 0x00007f12174790f9 in gst_task_func (task=0x1412050) at gsttask.c:316
#18 0x00007f12167fc976 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007f12167fbfb5 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x00007f121657a0a2 in start_thread () from /usr/lib/libpthread.so.0
#21 0x00007f12162ad32d in clone () from /usr/lib/libc.so.6



2014/1/23 Lautaro Woites <[hidden email]>



2014/1/23 Sebastian Dröge <[hidden email]>
On Mi, 2014-01-22 at 17:51 -0200, Lautaro Woites wrote:
> Hi again folks,
>
> I have this pipe: videotestsrc ! capsfilter ! videomixer ! xvimagesink.
> Then on PLAYING STATE I do:
>
> while (TRUE){
>     sleep(2);
>     add_mixer_input(); //adds an input on the videomixer
>     sleep(2);
>     remove_mixer_input(); //removes the previously added input to the mixer.
> }
>
> The inputs are bins with videotestsrc and a capsfilter. The example runs
> for a time (sometimes 5 minutes, sometimes 30 min, others 10 seconds) and
> then produces a segmentation fault on the videomixer (at
> gst_collect_pads_check_collected:1031).
>
> This is what I do to remove the input:
>      a) I  block the videotestsrc's src pad.
>      b) I send an EOS event to the capsfilter's sink pad and I wait for the
> event on the bin's src pad ( with an event probe).
>      c) On the  event probe's callback I drop the EOS and I unlink the bin
> with the mixer.
>      d) I set the bin to STATE_NULL and I remove it from the pipe.
>      e) I call release_request_pad on the mixer.
>      f) I remove the block pad on the videotestsrc.
> Also I've tried: to send EOS to the videtestsrc - set the bin to STATE_NULL
> and remove it - and finally call release_request_pad on the mixer.
> The program  crashed in the same line .
>
> NOTE:   If I remove the call to gst_release_request_pad the program seems
> to work OK. But the mixer's will still having unused sink pads :(.

The sequence of actions sounds correct

> I have some question about this:
>    1) I don't know if I am missing something or if there is a bug.
>    2) If I'm doing something wrong, What's the correct/safest  protocol to
> remove an input from the mixer?.
>    3) is it related with this ticket:
> https://bugzilla.gnome.org/show_bug.cgi?id=701110 ?

It might indeed be this bug, but then it wouldn't happen always. Could
you attach a testcase to that bug that reproduces the crash? What you're
doing is supposed to work and definitely should not crash.


OK I've attached an example to the ticket.

Hope it helps. If you need more info just tell me.
 
--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

example.c (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gst 1.2.2] remove a request pad from videomixer cause SEGFAULT

Sebastian Dröge-3
On Fr, 2014-01-24 at 10:56 -0200, Lautaro Woites wrote:

> The backtrace in the previous mail was obtained by running the example with
> the arch linux binaries.
> Now, I'm  running the example with a gst-uninstalled setup and the program
> blows up also on videomixer but in another place.
>
>
>
>  I've forgotten to attach the example on the previous mail. I'am attaching
> it now.
>
> [...]
Yeah all these backtraces strongly suggest that it's the bug to which
you added your example. It looks like videomixer is still using the pad
that you just removed, which happens because of the suboptimal locking
in videomixer and the duplicated pad storage as described in the bug.

--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment