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 628640 - v4l2src crashes if device is busy
v4l2src crashes if device is busy
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.21
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-02 20:26 UTC by Alexey Chernov
Modified: 2010-09-12 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program (779 bytes, application/octet-stream)
2010-09-02 20:26 UTC, Alexey Chernov
Details
Log of the 2nd instance of test program (9.77 KB, text/plain)
2010-09-02 20:27 UTC, Alexey Chernov
Details

Description Alexey Chernov 2010-09-02 20:26:26 UTC
Created attachment 169392 [details]
Test program

v4l2src crashes if capture device (i.e. /dev/video0 or so) is busy. It prints all the necessary errors ok but continue pending PLAYING state instead of going to NULL. 100% reproducible.

To reproduce:
1. Start the 1st instance of attached sample program (it uses /dev/video0). See the process is ok.
2. Start the second instance of it. Mention how it fails with segmentation fault.

I've switched on debug level to INFO in the sample program, it shows that the process overall goes normally but skips fatal errors and crashes.

Backtrace:
  • #0 ??
  • #1 gst_v4l2src_create
    at gstv4l2src.c line 914
  • #2 gst_push_src_create
    at gstpushsrc.c line 117
  • #3 gst_base_src_get_range
    at gstbasesrc.c line 2081
  • #4 gst_base_src_loop
    at gstbasesrc.c line 2334
  • #5 gst_task_func
    at gsttask.c line 238
  • #6 default_func
    at gsttaskpool.c line 70
  • #7 ??
    from /lib/libglib-2.0.so.0
  • #8 ??
    from /lib/libglib-2.0.so.0
  • #9 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #10 clone
    from /lib/tls/i686/cmov/libc.so.6

Source code of test program and output log of the 2nd instance is attached.
Comment 1 Alexey Chernov 2010-09-02 20:27:06 UTC
Created attachment 169393 [details]
Log of the 2nd instance of test program
Comment 2 Tim-Philipp Müller 2010-09-03 11:57:21 UTC
0.10.21 is quite old, have you tried with a more recent version?

It seems to error out fine for me:

$ gst-launch-0.10 v4l2src ! fakesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' cannot capture at 704x576
Additional debug info:
gstv4l2object.c(1951): gst_v4l2_object_set_format (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Call to S_FMT failed for YUYV @ 704x576: Device or resource busy
Setting pipeline to NULL ...
Freeing pipeline ...


Your test program also doesn't crash for me with git / latest releases.
Comment 3 Alexey Chernov 2010-09-03 19:44:50 UTC
Not really, this is version of gst-plugins-good which is included in Ubuntu 10.04 where I found the bug. I'll try to compile recent version from sources there and write the result here.
Comment 4 Tim-Philipp Müller 2010-09-04 11:42:18 UTC
There's a GStreamer PPA with ubuntu packages of the latest versions.
Comment 5 Alexey Chernov 2010-09-05 18:38:29 UTC
Well, it seems that also the bug depends on v4l driver itself. I found it with uvcvideo driver and web-camera but with cx23885-powered tv-tuner it isn't reproducible even with 0.10.21 version..
I'll do further testing and post the results here
Comment 6 Alexey Chernov 2010-09-12 12:22:05 UTC
I've performed some tests and here's the results:
1. Crash is always reproducible ONLY with gst-plugins-good-0.10.21 placed in ubuntu official ppa (package name is gstreamer0.10-plugins-good-0.10.21-ubuntu3 to be exact).
2. With default package built from sources (even 0.10.21 version) crash doesn't appear.
3. With ubuntu packaged good-plugins crash is reproducible with any v4l2 drivers and with source package it is not reproducible with any v4l2 drivers.

So I think the problem completely in Ubuntu package. I think we can close this bug as WORKSFORME as soon as it won't be reproducible in 10.10 or in any Ubuntu updates of next gst-plugins-good versions.
Comment 7 Tim-Philipp Müller 2010-09-12 15:44:20 UTC
Ok, thanks for checking. I assume you had libv4l-dev installed and checked if the plugin was using the libv4l wrapper(s) or not.

I'll resolve it as OBSOLETE since we don't have WORKSFORME. Please re-open if you can reproduce this with the latest -good release (ie. >= 0.10.25)
Comment 8 Alexey Chernov 2010-09-12 19:01:01 UTC
Thank you.
I also should add that I've also tested fresh versions from GStreamer Ubuntu ppa (i.e. 0.10.25 of plugins-good). The bug isn't reproducible. But I'll check the next official Ubuntu update of gst packages to make it clear completely.