Videotestsrc, input-selector and Segfaults.

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

Videotestsrc, input-selector and Segfaults.

Eric M
I'm using a pair of videotestsrc elements to simulate some other sources
while doing some testing on the Pi3 (On Raspbian Stretch, Gstreamer 1.10).

I noticed that when setting the following pipeline (See below) to playing in
a C program, it will sometimes (about 10 out of 11 times) cause a segfault.
It does not appear to cause a segfault if launched from gst-launch-1.0 (but
I can't use the input-selector there), and it does not seem to cause a
segfault if I specify format=RGB for both videotestsrc elements.  The
segfault also goes away if I replace one videotestsrc with a different
element like a udpsrc.  If the pipeline launches successfully, it will work
perfectly.

The segfaults will still occur if this pipeline is simplified, although they
do seem to happen more rarely.  It's hard to pin down exactly what causes
it.

I'm curious, is specifying a format when using input-selector an requirement
that I overlooked?  Or is more likely something going wrong during
negotiation and forcing the format just happens to fix it?

"videotestsrc pattern=black !
video/x-raw,width=320,height=240,framerate=10/1 ! queue ! videoin.
videotestsrc ! video/x-raw,width=640,height=480,framerate=10/1 ! queue !
videorate ! video/x-raw,framrate=10/1 ! videoscale !
video/x-raw,width=320,height=240 ! queue ! videoin. input-selector
name=videoin ! textoverlay vertical-render=true  shaded-background=true
valignment=center line-alignment=center halignment=center font-desc=\"DejaVu
Sans Mono,48\" name=textinput ! videoflip method=2 ! videoconvert !
fbdevsink device=/dev/fb1"



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

Re: Videotestsrc, input-selector and Segfaults.

Martin Maurer
Hi Eric,

I think it would be helpful, if you can share the C source code and some
build instructions.

Have you tried gdb to locate the location of the crash?

Best regards,

Martin


Am 16.09.2017 um 02:33 schrieb Eric M:

> I'm using a pair of videotestsrc elements to simulate some other sources
> while doing some testing on the Pi3 (On Raspbian Stretch, Gstreamer 1.10).
>
> I noticed that when setting the following pipeline (See below) to playing in
> a C program, it will sometimes (about 10 out of 11 times) cause a segfault.
> It does not appear to cause a segfault if launched from gst-launch-1.0 (but
> I can't use the input-selector there), and it does not seem to cause a
> segfault if I specify format=RGB for both videotestsrc elements.  The
> segfault also goes away if I replace one videotestsrc with a different
> element like a udpsrc.  If the pipeline launches successfully, it will work
> perfectly.
>
> The segfaults will still occur if this pipeline is simplified, although they
> do seem to happen more rarely.  It's hard to pin down exactly what causes
> it.
>
> I'm curious, is specifying a format when using input-selector an requirement
> that I overlooked?  Or is more likely something going wrong during
> negotiation and forcing the format just happens to fix it?
>
> "videotestsrc pattern=black !
> video/x-raw,width=320,height=240,framerate=10/1 ! queue ! videoin.
> videotestsrc ! video/x-raw,width=640,height=480,framerate=10/1 ! queue !
> videorate ! video/x-raw,framrate=10/1 ! videoscale !
> video/x-raw,width=320,height=240 ! queue ! videoin. input-selector
> name=videoin ! textoverlay vertical-render=true  shaded-background=true
> valignment=center line-alignment=center halignment=center font-desc=\"DejaVu
> Sans Mono,48\" name=textinput ! videoflip method=2 ! videoconvert !
> fbdevsink device=/dev/fb1"
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Videotestsrc, input-selector and Segfaults.

Eric M
I uploaded the test program with make file and full dump of the output at
debug level 9 and a gdb backtrace here.

https://github.com/Swap-File/gstcrashtest/
(see below for just the backtrace so you don't need to download a 10MB text
file)

After some more poking around, I found that the segfault only occurs if I
link -lwiringPi, a Pi specific library for dealing with I/O.  I suppose I
should really be poking around in wiringpi to find the problem, or take the
easier way out and just separate anything that uses wiringpi into a separate
program. Note:  I don't actually use wiringpi in the test program, I just
link to it, but my full application would ideally use it.

-Eric


#0  0x769b8540 in ?? ()
#1  0x76984acc in video_orc_pack_I420 (d1=0x74e47000 "", d1@entry=0x74e08c50
'\020' <repeats 200 times>...,
    d2=d2@entry=0x74e1b850 '\200' <repeats 160 times>, "RGV, V144
L_4,04YEG,B_AE12 B_4,00,(,3hi "..., d3=d3@entry=0x74e20350 "",
    s1=s1@entry=0x74e05b90
"\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200\377\020\200\200"...,
n=n@entry=160) at tmp-orc.c:1266
#2  0x769488bc in pack_planar_420 (info=<optimized out>, flags=<optimized
out>, src=0x74e05b90, sstride=<optimized out>, data=0x74cfea64,
stride=0x74cfea34, chroma_site=GST_VIDEO_CHROMA_SITE_NONE,
    y=0, width=320) at video-format.c:130
#3  0x769cd448 in convert_hline_generic (p=<optimized out>,
frame=0x74cfe9e4, y=1989868348) at videotestsrc.c:1199
#4  0x769cd138 in videotestsrc_convert_tmpline (p=p@entry=0x74cfe8d8,
frame=frame@entry=0x74cfe9e4, j=j@entry=1) at videotestsrc.c:275
#5  0x769cd954 in gst_video_test_src_unicolor (v=<optimized out>,
frame=0x74cfe9e4, color_index=<optimized out>) at videotestsrc.c:550
#6  0x769ca728 in gst_video_test_src_fill (psrc=<optimized out>,
buffer=0x74e25048) at gstvideotestsrc.c:1022
#7  0x768f36c4 in gst_base_src_default_create (src=0x1960a0,
offset=<optimized out>, size=4096, buffer=0x74cfeca4) at gstbasesrc.c:1486
#8  0x768f6c98 in gst_base_src_get_range (src=src@entry=0x1960a0,
offset=8572410113815957408, length=<optimized out>, length@entry=4096,
buf=0x74cfed58, buf@entry=0x74cfed50) at gstbasesrc.c:2464
#9  0x768f8e2c in gst_base_src_loop (pad=0x198020) at gstbasesrc.c:2740
#10 0x76f37a3c in gst_task_func (task=0x1cf178) at gsttask.c:334
#11 0x76d98324 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel