<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>214811</bug_id>
          
          <creation_ts>2020-07-26 13:32:10 -0700</creation_ts>
          <short_desc>[GTK] Web process crash during user media permission request calling gst_v4l2_open()</short_desc>
          <delta_ts>2020-08-11 09:11:55 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=214812</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pnormand</cc>
    
    <cc>vjaquez</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1675139</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-07-26 13:32:10 -0700</bug_when>
    <thetext>I&apos;m going to try and see if I can figure out how to reproduce this. I think it occurred testing a bluejeans.com call. (Maybe it occurs when my webcam is in use elsewhere?) Obviously (from the backtrace) it&apos;s related to the user media permission request. Note frame 5 of the backtrace:

#5  0x00007f37a0438b09 in gst_v4l2_open (v4l2object=v4l2object@entry=0x2b54690) at v4l2_calls.c:621
        __txt = 0x2b55610 &quot;Could not open device &apos;/dev/video1&apos; for reading and writing.&quot;
        __dbg = 0x2b55510 &quot;system error: Permission denied&quot;
        st = 
            {st_dev = 5, st_ino = 602862, st_nlink = 0, st_mode = 8192, st_uid = 65534, st_gid = 65534, __pad0 = 0, st_rdev = 20737, st_size = 0, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1595793989, tv_nsec = 230543748}, st_mtim = {tv_sec = 1595793989, tv_nsec = 230543748}, st_ctim = {tv_sec = 1595794051, tv_nsec = 425020882}, __glibc_reserved = {0, 0, 0}}
        libv4l2_fd = -1
        __func__ = &quot;gst_v4l2_open&quot;

I&apos;m skeptical that gst_v4l2_open() should be called in the UI process, especially since this is unsandboxed.

#0  g_logv
    (log_domain=0x7f502aa81960 &lt;g_log_domain_gstreamer&gt; &quot;GStreamer&quot;, log_level=G_LOG_LEVEL_CRITICAL, format=&lt;optimized out&gt;, args=&lt;optimized out&gt;) at ../glib/gmessages.c:1377
        domain = 0x0
        data = 0x0
        depth = 0
        log_func = 0x7f502a9d15e0 &lt;debug_log_handler&gt;
        domain_fatal_mask = &lt;optimized out&gt;
        masquerade_fatal = &lt;optimized out&gt;
        test_level = &lt;optimized out&gt;
        was_fatal = &lt;optimized out&gt;
        was_recursion = &lt;optimized out&gt;
        msg = 0x2b555a0 &quot;gst_element_message_full_with_details: assertion &apos;GST_IS_ELEMENT (element)&apos; failed&quot;
        msg_alloc = 0x2b555a0 &quot;gst_element_message_full_with_details: assertion &apos;GST_IS_ELEMENT (element)&apos; failed&quot;
        i = 3
#1  0x00007f502a0e7233 in g_log
    (log_domain=&lt;optimized out&gt;, log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f502a1396ff &quot;%s: assertion &apos;%s&apos; failed&quot;) at ../glib/gmessages.c:1415
        args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7ffdd3d9fe60, reg_save_area = 0x7ffdd3d9fda0}}
#2  0x00007f502a0e7a2d in g_return_if_fail_warning
    (log_domain=&lt;optimized out&gt;, pretty_function=pretty_function@entry=0x7f502aa8cac0 &lt;__func__.24665&gt; &quot;gst_element_message_full_with_details&quot;, expression=&lt;optimized out&gt;) at ../glib/gmessages.c:2771
#3  0x00007f502aa02c08 in gst_element_message_full_with_details
    (element=&lt;optimized out&gt;, type=type@entry=GST_MESSAGE_ERROR, domain=3135, code=code@entry=7, text=text@entry=0x2b55610 &quot;Could not open device &apos;/dev/video1&apos; for reading and writing.&quot;, debug=debug@entry=0x2b55510 &quot;system error: Permission denied&quot;, file=0x7f37a04464e9 &quot;v4l2_calls.c&quot;, function=0x7f37a0447360 &lt;__func__.29605&gt; &quot;gst_v4l2_open&quot;, line=621, structure=0x0) at gstelement.c:2112
        gerror = 0x0
        name = &lt;optimized out&gt;
        sent_text = &lt;optimized out&gt;
        sent_debug = &lt;optimized out&gt;
        has_debug = 1
        message = 0x0
        __PRETTY_FUNCTION__ = &quot;gst_element_message_full_with_details&quot;
        __func__ = &quot;gst_element_message_full_with_details&quot;
#4  0x00007f502aa02c4c in gst_element_message_full
    (element=&lt;optimized out&gt;, type=type@entry=GST_MESSAGE_ERROR, domain=&lt;optimized out&gt;, code=code@entry=7, text=text@entry=0x2b55610 &quot;Could not open device &apos;/dev/video1&apos; for reading and writing.&quot;, debug=debug@entry=0x2b55510 &quot;system error: Permission denied&quot;, file=0x7f37a04464e9 &quot;v4l2_calls.c&quot;, function=0x7f37a0447360 &lt;__func__.29605&gt; &quot;gst_v4l2_open&quot;, line=621) at gstelement.c:2204
#5  0x00007f37a0438b09 in gst_v4l2_open (v4l2object=v4l2object@entry=0x2b54690) at v4l2_calls.c:621
        __txt = 0x2b55610 &quot;Could not open device &apos;/dev/video1&apos; for reading and writing.&quot;
        __dbg = 0x2b55510 &quot;system error: Permission denied&quot;
        st = 
            {st_dev = 5, st_ino = 602862, st_nlink = 0, st_mode = 8192, st_uid = 65534, st_gid = 65534, __pad0 = 0, st_rdev = 20737, st_size = 0, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1595793989, tv_nsec = 230543748}, st_mtim = {tv_sec = 1595793989, tv_nsec = 230543748}, st_ctim = {tv_sec = 1595794051, tv_nsec = 425020882}, __glibc_reserved = {0, 0, 0}}
        libv4l2_fd = -1
        __func__ = &quot;gst_v4l2_open&quot;
#6  0x00007f37a0414dfb in gst_v4l2_device_provider_probe_device
    (device_name=0x0, props=0x1016860, device_path=0x2b4df10 &quot;/dev/video1&quot;, provider=0x2b39b90 [GstV4l2DeviceProvider|--Type &lt;RET&gt; for more, q to quit, c to continue without paging--c
v4l2deviceprovider0]) at gstv4l2deviceprovider.c:119
        v4l2obj = 0x2b54690
        device = 0x0 [GstV4l2Device]
        type = GST_V4L2_DEVICE_TYPE_INVALID
        caps = &lt;optimized out&gt;
        st = {st_dev = 5, st_ino = 602862, st_nlink = 0, st_mode = 8192, st_uid = 65534, st_gid = 65534, __pad0 = 0, st_rdev = 20737, st_size = 0, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1595793989, tv_nsec = 230543748}, st_mtim = {tv_sec = 1595793989, tv_nsec = 230543748}, st_ctim = {tv_sec = 1595794051, tv_nsec = 425020882}, __glibc_reserved = {0, 0, 0}}
        __func__ = &quot;gst_v4l2_device_provider_probe_device&quot;
        props = 0x1016860
        device = &lt;optimized out&gt;
        self = 0x2b39b90 [GstV4l2DeviceProvider|v4l2deviceprovider0]
        it = 0x2b54100
        devices = 0x0
#7  gst_v4l2_device_provider_probe (provider=0x2b39b90 [GstV4l2DeviceProvider|v4l2deviceprovider0]) at gstv4l2deviceprovider.c:213
        props = 0x1016860
        device = &lt;optimized out&gt;
        self = 0x2b39b90 [GstV4l2DeviceProvider|v4l2deviceprovider0]
        it = 0x2b54100
        devices = 0x0
#8  0x00007f502a9fbc0d in gst_device_provider_get_devices (provider=provider@entry=0x2b39b90 [GstV4l2DeviceProvider|v4l2deviceprovider0]) at gstdeviceprovider.c:420
        klass = 0x2b58af0
        devices = 0x0
        started = &lt;optimized out&gt;
        item = &lt;optimized out&gt;
        __func__ = &quot;gst_device_provider_get_devices&quot;
#9  0x00007f502a9fa40d in gst_device_monitor_get_devices (monitor=0x2afa2b0 [GstDeviceMonitor|devicemonitor1]) at gstdevicemonitor.c:393
        tmpdev = &lt;optimized out&gt;
        provider = 0x2b39b90 [GstV4l2DeviceProvider|v4l2deviceprovider0]
        item = &lt;optimized out&gt;
        devices = 0x0
        hidden = 0x0
        i = 0
        cookie = 1
        __func__ = &quot;gst_device_monitor_get_devices&quot;
        __PRETTY_FUNCTION__ = &quot;gst_device_monitor_get_devices&quot;
#10 0x00007f5032b697b5 in WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices() (this=0x7f5034126740 &lt;WebCore::GStreamerVideoCaptureDeviceManager::singleton()::manager&gt;) at DerivedSources/ForwardingHeaders/wtf/glib/GRefPtr.h:105
        __FUNCTION__ = &quot;refreshCaptureDevices&quot;
        devices = &lt;optimized out&gt;
#11 0x00007f5032b6996a in WebCore::GStreamerCaptureDeviceManager::captureDevices() (this=this@entry=0x7f5034126740 &lt;WebCore::GStreamerVideoCaptureDeviceManager::singleton()::manager&gt;) at ../../Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:84
#12 0x00007f5032b699eb in WebCore::GStreamerCaptureDeviceManager::gstreamerDeviceWithUID(WTF::String const&amp;) (this=0x7f5034126740 &lt;WebCore::GStreamerVideoCaptureDeviceManager::singleton()::manager&gt;, deviceID=...) at ../../Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:71
#13 0x00007f5032b6b89e in WebCore::GStreamerVideoCaptureSource::create(WTF::String&amp;&amp;, WTF::String&amp;&amp;, WebCore::MediaConstraints const*) (deviceID=..., hashSalt=..., constraints=0x7f379bc039c8) at ../../Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:101
        device = {&lt;WTF::Optional_base&lt;WebCore::GStreamerCaptureDevice&gt;&gt; = {init_ = true, storage_ = {dummy_ = 0 &apos;\000&apos;, value_ = {&lt;WebCore::CaptureDevice&gt; = {m_persistentId = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}, m_type = WebCore::CaptureDevice::DeviceType::Microphone, m_label = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}, m_groupId = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}, m_enabled = true}, m_device = {m_ptr = 0x2afa350 [GstPulseDevice|pulsedevice2]}}}}, &lt;No data fields&gt;}
        source = &lt;optimized out&gt;
#14 0x00007f5032b6cc4f in WebCore::GStreamerVideoCaptureSourceFactory::createVideoCaptureSource(WebCore::CaptureDevice const&amp;, WTF::String&amp;&amp;, WebCore::MediaConstraints const*) (this=&lt;optimized out&gt;, device=..., hashSalt=..., constraints=&lt;optimized out&gt;) at DerivedSources/ForwardingHeaders/wtf/text/StringImpl.h:1107
#15 0x00007f50323b4c39 in WebCore::RealtimeMediaSourceCenter::createMediaStream(WTF::Ref&lt;WTF::Logger const, WTF::DumbPtrTraits&lt;WTF::Logger const&gt; &gt;&amp;&amp;, WTF::Function&lt;void (std::experimental::fundamentals_v3::expected&lt;WTF::Ref&lt;WebCore::MediaStreamPrivate, WTF::DumbPtrTraits&lt;WebCore::MediaStreamPrivate&gt; &gt;, WTF::String&gt;&amp;&amp;)&gt;&amp;&amp;, WTF::String&amp;&amp;, WebCore::CaptureDevice&amp;&amp;, WebCore::CaptureDevice&amp;&amp;, WebCore::MediaStreamRequest const&amp;) (this=this@entry=0x7f503411d4c0 &lt;WebCore::RealtimeMediaSourceCenter::singleton()::center&gt;, logger=..., completionHandler=..., hashSalt=..., audioDevice=..., videoDevice=..., request=...) at ../../Source/WebCore/platform/mediastream/CaptureDevice.h:65
        source = {captureSource = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}, errorMessage = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}}
        invalidConstraint = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}
        audioSource = &lt;optimized out&gt;
        videoSource = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}
#16 0x00007f50318ccd8e in operator() (__closure=0x7f379aa8d8f8) at /usr/include/c++/10/bits/atomic_base.h:325
        &lt;truncated by mcatanzaro&gt;
#17 WTF::Detail::CallableWrapper&lt;WebCore::UserMediaRequest::allow(WebCore::CaptureDevice&amp;&amp;, WebCore::CaptureDevice&amp;&amp;, WTF::String&amp;&amp;, WTF::CompletionHandler&lt;void()&gt;&amp;&amp;)::&lt;lambda()&gt;, void&gt;::call(void) (this=0x7f379aa8d8f0) at DerivedSources/ForwardingHeaders/wtf/Function.h:52
#18 0x00007f5031c97482 in WTF::Function&lt;void ()&gt;::operator()() const (this=&lt;optimized out&gt;) at /usr/include/c++/10/bits/unique_ptr.h:420
        group = &lt;optimized out&gt;
        task = std::unique_ptr&lt;class WebCore::EventLoopTask&gt; = {get() = 0x7f379296e000}
        __for_range = &lt;synthetic pointer&gt;: &lt;optimized out&gt;
        __for_begin = 0x7f37979b2780
        __for_end = 0x7f37979b2788
        remainingTasks = {&lt;WTF::VectorBuffer&lt;std::unique_ptr&lt;WebCore::EventLoopTask, std::default_delete&lt;WebCore::EventLoopTask&gt; &gt;, 0, WTF::FastMalloc&gt;&gt; = {&lt;WTF::VectorBufferBase&lt;std::unique_ptr&lt;WebCore::EventLoopTask, std::default_delete&lt;WebCore::EventLoopTask&gt; &gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x0, m_capacity = 0, m_size = 0}, &lt;No data fields&gt;}, &lt;No data fields&gt;}
        didPerformMicrotaskCheckpoint = false
#19 WebCore::EventLoopFunctionDispatchTask::execute() (this=&lt;optimized out&gt;) at ../../Source/WebCore/dom/EventLoop.cpp:134
        group = &lt;optimized out&gt;
        task = std::unique_ptr&lt;class WebCore::EventLoopTask&gt; = {get() = 0x7f379296e000}
        __for_range = &lt;synthetic pointer&gt;: &lt;optimized out&gt;
        __for_begin = 0x7f37979b2780
        __for_end = 0x7f37979b2788
        remainingTasks = {&lt;WTF::VectorBuffer&lt;std::unique_ptr&lt;WebCore::EventLoopTask, std::default_delete&lt;WebCore::EventLoopTask&gt; &gt;, 0, WTF::FastMalloc&gt;&gt; = {&lt;WTF::VectorBufferBase&lt;std::unique_ptr&lt;WebCore::EventLoopTask, std::default_delete&lt;WebCore::EventLoopTask&gt; &gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x0, m_capacity = 0, m_size = 0}, &lt;No data fields&gt;}, &lt;No data fields&gt;}
        didPerformMicrotaskCheckpoint = false
#20 WebCore::EventLoop::run() (this=this@entry=0x7f501906c190) at ../../Source/WebCore/dom/EventLoop.cpp:98
        group = &lt;optimized out&gt;
        task = std::unique_ptr&lt;class WebCore::EventLoopTask&gt; = {get() = 0x7f379296e000}
        __for_range = &lt;synthetic pointer&gt;: &lt;optimized out&gt;
        __for_begin = 0x7f37979b2780
        __for_end = 0x7f37979b2788
        remainingTasks = {&lt;WTF::VectorBuffer&lt;std::unique_ptr&lt;WebCore::EventLoopTask, std::default_delete&lt;WebCore::EventLoopTask&gt; &gt;, 0, WTF::FastMalloc&gt;&gt; = {&lt;WTF::VectorBufferBase&lt;std::unique_ptr&lt;WebCore::EventLoopTask, std::default_delete&lt;WebCore::EventLoopTask&gt; &gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x0, m_capacity = 0, m_size = 0}, &lt;No data fields&gt;}, &lt;No data fields&gt;}
        didPerformMicrotaskCheckpoint = false
#21 0x00007f5031d1808d in WebCore::WindowEventLoop::didReachTimeToRun() (this=0x7f501906c190) at ../../Source/WebCore/dom/WindowEventLoop.cpp:120
        protectedThis = {static isRef = &lt;optimized out&gt;, m_ptr = 0x7f501906c190}
#22 0x00007f50322b2a04 in WebCore::ThreadTimers::sharedTimerFiredInternal() (this=0x7f5019093de8) at ../../Source/WebCore/platform/ThreadTimers.h:106
        item = {static isRef = &lt;optimized out&gt;, m_ptr = 0x7f37a199b150}
        timer = &lt;optimized out&gt;
        interval = &lt;optimized out&gt;
        timeToQuit = &lt;optimized out&gt;
#23 WebCore::ThreadTimers::sharedTimerFiredInternal() (this=0x7f5019093de8) at ../../Source/WebCore/platform/ThreadTimers.cpp:99
#24 0x00007f502e499a9d in operator() (__closure=0x0, userData=0x7f503411c750 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+16&gt;) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:147
        timer = 0x7f503411c750 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+16&gt;
        source = 0x12f0c10
#25 _FUN(gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:150
#26 0x00007f502a0df78f in g_main_dispatch (context=0xe6eac0) at ../glib/gmain.c:3309
        dispatch = &lt;optimized out&gt;
        prev_source = 0x0
        was_in_call = &lt;optimized out&gt;
        user_data = 0x7f503411c750 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+16&gt;
        callback = 0x7f502e499a10 &lt;_FUN(gpointer)&gt;
        cb_funcs = 0x7f502a1b5280 &lt;g_source_callback_funcs&gt;
        cb_data = 0x12f0cb0
        need_destroy = &lt;optimized out&gt;
        source = 0x12f0c10
        current = 0xe76830
        i = 1
        __func__ = &quot;g_main_dispatch&quot;
#27 g_main_context_dispatch (context=0xe6eac0) at ../glib/gmain.c:3974
#28 0x00007f502a0dfb18 in g_main_context_iterate (context=0xe6eac0, block=block@entry=1, dispatch=dispatch@entry=1, self=&lt;optimized out&gt;) at ../glib/gmain.c:4047
        max_priority = 100
        timeout = 0
        some_ready = 1
        nfds = &lt;optimized out&gt;
        allocated_nfds = &lt;optimized out&gt;
        fds = 0xfc8990
#29 0x00007f502a0dfe33 in g_main_loop_run (loop=loop@entry=0xf97630) at ../glib/gmain.c:4241
        __func__ = &quot;g_main_loop_run&quot;
#30 0x00007f502e499c80 in WTF::RunLoop::run() () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:96
        runLoop = @0x7f50190f9000: {&lt;WTF::FunctionDispatcher&gt; = {&lt;WTF::ThreadSafeRefCounted&lt;WTF::FunctionDispatcher, (WTF::DestructionThread)0&gt;&gt; = {&lt;WTF::ThreadSafeRefCountedBase&gt; = {m_refCount = {&lt;std::__atomic_base&lt;unsigned int&gt;&gt; = {static _S_alignment = 4, _M_i = 33}, static is_always_lock_free = true}}, &lt;No data fields&gt;}, _vptr.FunctionDispatcher = 0x7f502e7cd158 &lt;vtable for WTF::RunLoop+16&gt;}, m_currentIteration = {m_start = 1, m_end = 1, m_buffer = {&lt;WTF::VectorBufferBase&lt;WTF::Function&lt;void()&gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x7f501904a000, m_capacity = 16, m_size = 0}, &lt;No data fields&gt;}}, m_nextIterationLock = {static isHeldBit = 1 &apos;\001&apos;, static hasParkedBit = 2 &apos;\002&apos;, m_byte = {value = {&lt;std::__atomic_base&lt;unsigned char&gt;&gt; = {static _S_alignment = 1, _M_i = 0 &apos;\000&apos;}, static is_always_lock_free = true}}}, m_nextIteration = {m_start = 0, m_end = 1, m_buffer = {&lt;WTF::VectorBufferBase&lt;WTF::Function&lt;void()&gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x7f501904a080, m_capacity = 16, m_size = 0}, &lt;No data fields&gt;}}, m_isFunctionDispatchSuspended = false, m_hasSuspendedFunctions = false, m_mainContext = {m_ptr = 0xe6eac0}, m_mainLoops = {&lt;WTF::VectorBuffer&lt;WTF::GRefPtr&lt;_GMainLoop&gt;, 0, WTF::FastMalloc&gt;&gt; = {&lt;WTF::VectorBufferBase&lt;WTF::GRefPtr&lt;_GMainLoop&gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x7f50190f9080, m_capacity = 16, m_size = 1}, &lt;No data fields&gt;}, &lt;No data fields&gt;}, m_source = {m_ptr = 0xf18970}}
        mainContext = 0xe6eac0
        innermostLoop = 0xf97630
        nestedMainLoop = &lt;optimized out&gt;
#31 0x00007f503101e01f in WebKit::AuxiliaryProcessMain&lt;WebKit::WebProcess, WebKit::WebProcessMainGtk&gt;(int, char**) (argc=3, argv=&lt;optimized out&gt;) at ../../Source/WebKit/Shared/AuxiliaryProcessMain.h:49
        auxiliaryMain = {&lt;WebKit::AuxiliaryProcessMainBase&gt; = {_vptr.AuxiliaryProcessMainBase = 0x7f5033dafa10 &lt;vtable for WebKit::WebProcessMainGtk+16&gt;, m_parameters = {uiProcessName = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}, clientIdentifier = {static MaxLength = 2147483647, m_impl = {static isRefPtr = &lt;optimized out&gt;, m_ptr = 0x0}}, processIdentifier = {&lt;WTF::constexpr_Optional_base&lt;WTF::ObjectIdentifier&lt;WebCore::ProcessIdentifierType&gt; &gt;&gt; = {init_ = true, storage_ = {dummy_ = 68 &apos;D&apos;, value_ = {&lt;WTF::ObjectIdentifierBase&gt; = {&lt;No data fields&gt;}, m_identifier = 68, static m_generationProtected = false}}}, &lt;No data fields&gt;}, connectionIdentifier = 65, extraInitializationData = {m_impl = {static smallMaxLoadNumerator = &lt;optimized out&gt;, static smallMaxLoadDenominator = &lt;optimized out&gt;, static largeMaxLoadNumerator = &lt;optimized out&gt;, static largeMaxLoadDenominator = &lt;optimized out&gt;, static maxSmallTableCapacity = &lt;optimized out&gt;, static minLoad = &lt;optimized out&gt;, static tableSizeOffset = &lt;optimized out&gt;, static tableSizeMaskOffset = &lt;optimized out&gt;, static keyCountOffset = &lt;optimized out&gt;, static deletedCountOffset = &lt;optimized out&gt;, static metadataSize = &lt;optimized out&gt;, m_table = 0x0}}, processType = 64}}, &lt;No data fields&gt;}
#32 0x00007f5028a99042 in __libc_start_main (main=0x400b20 &lt;main(int, char**)&gt;, argc=3, argv=0x7ffdd3da0878, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7ffdd3da0868) at ../csu/libc-start.c:308
        result = &lt;optimized out&gt;
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -5900587206844801872, 4197248, 0, 0, 0, 5901756234023640240, 5817725899212266672}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x3, 0x7ffdd3da0878}, data = {prev = 0x0, cleanup = 0x0, canceltype = 3}}}
        not_first_call = &lt;optimized out&gt;
#33 0x0000000000400bae in _start ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1675142</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-07-26 13:45:44 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; I&apos;m going to try and see if I can figure out how to reproduce this. I think
&gt; it occurred testing a bluejeans.com call. (Maybe it occurs when my webcam is
&gt; in use elsewhere?) Obviously (from the backtrace) it&apos;s related to the user
&gt; media permission request. Note frame 5 of the backtrace:

Apologies, this is actually a web process crash. I got confused because I have two backtraces that look almost the same, and the other one is a UI process crash. I have separately reported bug #214812 for the UI process crash since using GStreamer in the UI process requires special scrutiny.

Finally, note this is a G_DEBUG=fatal-criticals crash, I use that in my jhbuild environment to crash as early as possible for the best backtrace.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1677945</commentid>
    <comment_count>2</comment_count>
    <who name="Víctor M. Jáquez L.">vjaquez</who>
    <bug_when>2020-08-05 08:48:16 -0700</bug_when>
    <thetext>Since right now it is expected to access the camera from WebProcess, is this a bug? or a missing rule in the sandbox?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1677972</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-08-05 10:09:53 -0700</bug_when>
    <thetext>Well it&apos;s definitely a bug. Even if there&apos;s no permission to access /dev/video1, WebKit shouldn&apos;t crash. That&apos;s happening because of this critical: assertion &apos;GST_IS_ELEMENT (element)&apos; failed. So that&apos;s the first issue to fix.

Now, as to why the permission error is occurring... I think you were correct to guess a sandbox problem. I would actually never have thought of that, but that must be it. There&apos;s actually sandbox rule to bind /dev/video1 in bindV4l in BubblewrapLauncher.cpp. But it can only be bound if it already exists at the time the web process is launched! Testing now, /dev/video0 and /dev/video1 are only created when I actually plug in my webcam, which I usually do long after the web process is already running. The sandbox will never be able to allow access to files that don&apos;t already exist at the time the web process is launched, so using /dev/video0 and /dev/video1 from the web process cannot be made to work. I&apos;m pretty sure pipewire is designed to avoid this problem, right? (We&apos;re going to need to hook up to pipewire to make desktop sharing work anyway. Maybe we should have a separate bug for pipewire integration?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1678226</commentid>
    <comment_count>4</comment_count>
    <who name="Víctor M. Jáquez L.">vjaquez</who>
    <bug_when>2020-08-06 03:38:59 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #3)
&gt; Well it&apos;s definitely a bug. Even if there&apos;s no permission to access
&gt; /dev/video1, WebKit shouldn&apos;t crash. That&apos;s happening because of this
&gt; critical: assertion &apos;GST_IS_ELEMENT (element)&apos; failed. So that&apos;s the first
&gt; issue to fix.

Did you compile WebKit with Flatpak?

If so, I guess I get why it is happening: We need to compile gstv4l2 without udev support, because flatpak can&apos;t handle it, and gstv4l2 fallbacks to traversing a hard-coded list of possible devices, where probing is opening try-and-error.

Then this probing is done without an element associated, raising the precondition check.

&gt; 
&gt; Now, as to why the permission error is occurring... I think you were correct
&gt; to guess a sandbox problem. I would actually never have thought of that, but
&gt; that must be it. There&apos;s actually sandbox rule to bind /dev/video1 in
&gt; bindV4l in BubblewrapLauncher.cpp. But it can only be bound if it already
&gt; exists at the time the web process is launched! Testing now, /dev/video0 and
&gt; /dev/video1 are only created when I actually plug in my webcam, which I
&gt; usually do long after the web process is already running. The sandbox will
&gt; never be able to allow access to files that don&apos;t already exist at the time
&gt; the web process is launched, so using /dev/video0 and /dev/video1 from the
&gt; web process cannot be made to work. I&apos;m pretty sure pipewire is designed to
&gt; avoid this problem, right? (We&apos;re going to need to hook up to pipewire to
&gt; make desktop sharing work anyway. Maybe we should have a separate bug for
&gt; pipewire integration?)

AFAIK, pipewire takes care of the available devices, so yes. But -- again, afaik -- we need to upgrade pipewire to work in flatpak</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1678229</commentid>
    <comment_count>5</comment_count>
    <who name="Víctor M. Jáquez L.">vjaquez</who>
    <bug_when>2020-08-06 04:24:56 -0700</bug_when>
    <thetext>https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/694</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1678241</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-08-06 07:02:43 -0700</bug_when>
    <thetext>(In reply to Víctor M. Jáquez L. from comment #4)
&gt; Did you compile WebKit with Flatpak?

No, I used GNOME jhbuild. And I probably did not compile GStreamer, so it&apos;s probably using system GStreamer.

&gt; AFAIK, pipewire takes care of the available devices, so yes. But -- again, afaik -- we need to upgrade pipewire to work in flatpak

We need to upgrade pipewire?

(In reply to Víctor M. Jáquez L. from comment #5)
&gt; https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/
&gt; 694

Cool! (But note I&apos;m not using fatal-warnings -- in fact, a warning might be appropriate if a GStreamer element is missing -- only fatal-criticals, which indicate programmer error.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1679340</commentid>
    <comment_count>7</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-08-11 01:49:21 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #6)
&gt; (In reply to Víctor M. Jáquez L. from comment #4)
&gt; &gt; Did you compile WebKit with Flatpak?
&gt; 
&gt; No, I used GNOME jhbuild. And I probably did not compile GStreamer, so it&apos;s
&gt; probably using system GStreamer.
&gt; 
&gt; &gt; AFAIK, pipewire takes care of the available devices, so yes. But -- again, afaik -- we need to upgrade pipewire to work in flatpak
&gt; 
&gt; We need to upgrade pipewire?
&gt; 

Clarifying a bit here...
The FDO SDK we depend on currently (19.08) doesn&apos;t provide a functional Pipewire. However I think it works correctly in the upcoming 20.08 branch. So whenever this is released the work on Pipewire support could start, there&apos;s https://bugs.webkit.org/show_bug.cgi?id=210926 open for screen sharing. Another bug could be open for camera devices access through pipewire, although I suspect it will just work out of the box.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1679392</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-08-11 07:50:11 -0700</bug_when>
    <thetext>Well you don&apos;t need to wait, you can pin to 20.08beta.6 like GNOME and Tech Preview are using. We upgrade it regularly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1679417</commentid>
    <comment_count>9</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-08-11 09:11:55 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #8)
&gt; Well you don&apos;t need to wait, you can pin to 20.08beta.6 like GNOME and Tech
&gt; Preview are using. We upgrade it regularly.

With the limited resources we have currently, we can&apos;t afford to update to every single beta of the FDO SDK.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>