Bug 228232 - [GTK] MiniBrowser crashes when closed while capturing desktop
Summary: [GTK] MiniBrowser crashes when closed while capturing desktop
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-23 03:55 PDT by Philippe Normand
Modified: 2021-08-16 06:34 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.64 KB, patch)
2021-07-24 03:25 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (3.76 KB, patch)
2021-08-16 03:31 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2021-07-23 03:55:34 PDT
1. Visit https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/
2. Click Start
3. Close the browser

(gdb) bt
#0  g_type_check_instance_cast (type_instance=0x1562280, iface_type=0x15570c0 [GtkEntry/GtkWidget/GInitiallyUnowned]) at ../gobject/gtype.c:4115
#1  0x000000000041897d in webViewMediaCaptureStateChanged ()
#5  0x00007f967fccead3 in <emit signal notify:camera-capture-state on instance 0x171ff20 [WebKitWebView]> (instance=instance@entry=0x171ff20, signal_id=<optimized out>, detail=<optimized out>)
    at ../gobject/gsignal.c:3553
    #2  0x00007f967fcb4fcf in g_closure_invoke
    (closure=0x16ffdb0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffed5482390, invocation_hint=invocation_hint@entry=0x7ffed5482310) at ../gobject/gclosure.c:810
    #3  0x00007f967fcc7e5b in signal_emit_unlocked_R
    (node=node@entry=0x11874c0, detail=detail@entry=1537, instance=instance@entry=0x171ff20, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed5482390)
    at ../gobject/gsignal.c:3741
    #4  0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed5482530) at ../gobject/gsignal.c:3497
#6  0x00007f967fcb9be4 in g_object_dispatch_properties_changed (object=0x171ff20 [WebKitWebView], n_pspecs=<optimized out>, pspecs=<optimized out>) at ../gobject/gobject.c:1206
#7  0x00007f967fcbbd9a in g_object_notify_by_spec_internal (pspec=<optimized out>, object=0x171ff20 [WebKitWebView]) at ../gobject/gobject.c:1299
#8  g_object_notify_by_pspec (object=0x171ff20 [WebKitWebView], pspec=<optimized out>) at ../gobject/gobject.c:1409
#9  0x00007f968609052e in webkitWebViewMediaCaptureStateDidChange(_WebKitWebView*, WTF::OptionSet<WebCore::MediaProducer::MediaState>) () at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#10 0x00007f9685fb1f83 in WebKit::WebPageProxy::updateReportedMediaCaptureState() () at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#11 0x00007f9685fb8611 in WebKit::WebPageProxy::updatePlayingMediaDidChange(WTF::OptionSet<WebCore::MediaProducer::MediaState>, WebKit::WebPageProxy::CanDelayNotification) ()
    at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#12 0x00007f9685fb81cc in WebKit::WebPageProxy::resetState(WebKit::WebPageProxy::ResetStateReason) () at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#13 0x00007f9685fb430a in WebKit::WebPageProxy::close() () at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#14 0x00007f96860b9497 in webkitWebViewBaseDispose(_GObject*) () at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#15 0x00007f9686099a8f in webkitWebViewDispose(_GObject*) () at /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.1.so.0
#16 0x00007f967fcbb9f1 in g_object_run_dispose (object=0x171ff20 [WebKitWebView]) at ../gobject/gobject.c:1226
#17 0x00007f9684e01850 in gtk_overlay_forall (overlay=0x15cf9d0 [GtkOverlay], include_internals=<optimized out>, callback=0x7f9684f34050 <gtk_widget_destroy>, callback_data=0x0) at ../gtk/gtkoverlay.c:628
#18 0x00007f9684cdf14b in gtk_container_destroy (widget=0x15cf9d0 [GtkOverlay]) at ../gtk/gtkcontainer.c:1701
#22 0x00007f967fccead3 in <emit signal ??? on instance 0x15cf9d0 [GtkOverlay]> (instance=instance@entry=0x15cf9d0, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553
    #19 0x00007f967fcb4f0c in g_closure_invoke
    (closure=closure@entry=0x11da130, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffed5482a30, invocation_hint=invocation_hint@entry=0x7ffed54829b0)
    at ../gobject/gclosure.c:810
    #20 0x00007f967fcc7df5 in signal_emit_unlocked_R
    (node=node@entry=0x11f16d0, detail=detail@entry=0, instance=instance@entry=0x15cf9d0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed5482a30)
    at ../gobject/gsignal.c:3859
    #21 0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed5482bb0) at ../gobject/gsignal.c:3497
#23 0x00007f9684f3d8af in gtk_widget_dispose (object=0x15cf9d0 [GtkOverlay]) at ../gtk/gtkwidget.c:12162
#24 0x00007f967fcbb9f1 in g_object_run_dispose (object=0x15cf9d0 [GtkOverlay]) at ../gobject/gobject.c:1226
#25 0x00007f9684c8a5a8 in gtk_box_forall (container=<optimized out>, include_internals=<optimized out>, callback=0x7f9684f34050 <gtk_widget_destroy>, callback_data=0x0) at ../gtk/gtkbox.c:2675
#26 0x00007f9684cdf14b in gtk_container_destroy (widget=0x1737180 [BrowserTab]) at ../gtk/gtkcontainer.c:1701
#30 0x00007f967fccead3 in <emit signal ??? on instance 0x1737180 [BrowserTab]> (instance=instance@entry=0x1737180, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553
    #27 0x00007f967fcb4f0c in g_closure_invoke
    (closure=closure@entry=0x11da130, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffed5482eb0, invocation_hint=invocation_hint@entry=0x7ffed5482e30)
    at ../gobject/gclosure.c:810
    #28 0x00007f967fcc7df5 in signal_emit_unlocked_R
    (node=node@entry=0x11f16d0, detail=detail@entry=0, instance=instance@entry=0x1737180, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed5482eb0)
    at ../gobject/gsignal.c:3859
    #29 0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed5483030) at ../gobject/gsignal.c:3497
#31 0x00007f9684f3d8af in gtk_widget_dispose (object=0x1737180 [BrowserTab]) at ../gtk/gtkwidget.c:12162
#32 0x00007f967fcbb9f1 in g_object_run_dispose (object=0x1737180 [BrowserTab]) at ../gobject/gobject.c:1226
#33 0x00007f9684df9456 in gtk_notebook_forall (container=<optimized out>, include_internals=0, callback=0x7f9684f34050 <gtk_widget_destroy>, callback_data=0x0) at ../gtk/gtknotebook.c:4607
#34 0x00007f9684cdf14b in gtk_container_destroy (widget=0x1754510 [GtkNotebook]) at ../gtk/gtkcontainer.c:1701
#38 0x00007f967fccead3 in <emit signal ??? on instance 0x1754510 [GtkNotebook]> (instance=instance@entry=0x1754510, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553
    #35 0x00007f967fcb4f0c in g_closure_invoke
    (closure=closure@entry=0x11da130, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffed5483340, invocation_hint=invocation_hint@entry=0x7ffed54832c0)
    at ../gobject/gclosure.c:810
    #36 0x00007f967fcc7df5 in signal_emit_unlocked_R
--Type <RET> for more, q to quit, c to continue without paging--
    (node=node@entry=0x11f16d0, detail=detail@entry=0, instance=instance@entry=0x1754510, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed5483340)
    at ../gobject/gsignal.c:3859
    #37 0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed54834c0) at ../gobject/gsignal.c:3497
#39 0x00007f9684f3d8af in gtk_widget_dispose (object=0x1754510 [GtkNotebook]) at ../gtk/gtkwidget.c:12162
#40 0x00007f967fcbb9f1 in g_object_run_dispose (object=0x1754510 [GtkNotebook]) at ../gobject/gobject.c:1226
#41 0x00007f9684c8a5a8 in gtk_box_forall (container=<optimized out>, include_internals=<optimized out>, callback=0x7f9684f34050 <gtk_widget_destroy>, callback_data=0x0) at ../gtk/gtkbox.c:2675
#42 0x00007f9684cdf14b in gtk_container_destroy (widget=0x15b7cc0 [GtkBox]) at ../gtk/gtkcontainer.c:1701
#46 0x00007f967fccead3 in <emit signal ??? on instance 0x15b7cc0 [GtkBox]> (instance=instance@entry=0x15b7cc0, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553
    #43 0x00007f967fcb4f0c in g_closure_invoke
    (closure=closure@entry=0x11da130, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffed54837c0, invocation_hint=invocation_hint@entry=0x7ffed5483740)
    at ../gobject/gclosure.c:810
    #44 0x00007f967fcc7df5 in signal_emit_unlocked_R
    (node=node@entry=0x11f16d0, detail=detail@entry=0, instance=instance@entry=0x15b7cc0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed54837c0)
    at ../gobject/gsignal.c:3859
    #45 0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed5483940) at ../gobject/gsignal.c:3497
#47 0x00007f9684f3d8af in gtk_widget_dispose (object=0x15b7cc0 [GtkBox]) at ../gtk/gtkwidget.c:12162
#48 0x00007f967fcbb9f1 in g_object_run_dispose (object=0x15b7cc0 [GtkBox]) at ../gobject/gobject.c:1226
#49 0x00007f9684f4f9b9 in gtk_window_forall (container=0x15724a0 [BrowserWindow], include_internals=0, callback=0x7f9684f34050 <gtk_widget_destroy>, callback_data=0x0) at ../gtk/gtkwindow.c:8596
#50 0x00007f9684cdf14b in gtk_container_destroy (widget=0x15724a0 [BrowserWindow]) at ../gtk/gtkcontainer.c:1701
#54 0x00007f967fccead3 in <emit signal ??? on instance 0x15724a0 [BrowserWindow]> (instance=instance@entry=0x15724a0, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553
    #51 0x00007f967fcb4fcf in g_closure_invoke
    (closure=closure@entry=0x11da130, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffed5483c50, invocation_hint=invocation_hint@entry=0x7ffed5483bd0)
    at ../gobject/gclosure.c:810
    #52 0x00007f967fcc7df5 in signal_emit_unlocked_R
    (node=node@entry=0x11f16d0, detail=detail@entry=0, instance=instance@entry=0x15724a0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed5483c50)
    at ../gobject/gsignal.c:3859
    #53 0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed5483dd0) at ../gobject/gsignal.c:3497
#55 0x00007f9684f3d8af in gtk_widget_dispose (object=0x15724a0 [BrowserWindow]) at ../gtk/gtkwidget.c:12162
#56 0x00007f9684f52e20 in gtk_window_dispose (object=0x15724a0 [BrowserWindow]) at ../gtk/gtkwindow.c:3166
#57 0x00007f9684c7b456 in gtk_application_window_dispose (object=0x15724a0 [BrowserWindow]) at ../gtk/gtkapplicationwindow.c:804
#58 0x00007f967fcbb9f1 in g_object_run_dispose (object=0x15724a0 [BrowserWindow]) at ../gobject/gobject.c:1226
#62 0x00007f967fccead3 in <emit signal ??? on instance 0x171ff20 [WebKitWebView]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../gobject/gsignal.c:3553
    #59 0x00007f967fcb4fcf in g_closure_invoke
    (closure=0x1735100, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffed54840d0, invocation_hint=invocation_hint@entry=0x7ffed5484050) at ../gobject/gclosure.c:810
    #60 0x00007f967fcc7e5b in signal_emit_unlocked_R
    (node=node@entry=0x16e7620, detail=detail@entry=0, instance=instance@entry=0x171ff20, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffed54840d0)
    at ../gobject/gsignal.c:3741
    #61 0x00007f967fcce971 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed5484250) at ../gobject/gsignal.c:3497
#63 0x0000000000416589 in browserWindowTryClose ()
#64 0x000000000041636f in browserWindowDeleteEvent ()
#65 0x00007f9684c4bb18 in _gtk_marshal_BOOLEAN__BOXEDv
    (closure=0x11f7580, return_value=0x7ffed5484520, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x11f6850) at gtk/gtkmarshalers.c:130
#66 0x00007f967fcb5209 in _g_closure_invoke_va
    (closure=closure@entry=0x11f7580, return_value=return_value@entry=0x7ffed5484520, instance=instance@entry=0x15724a0, args=args@entry=0x7ffed54845f0, n_params=1, param_types=0x11f6850)
    at ../gobject/gclosure.c:873
#67 0x00007f967fccdc34 in g_signal_emit_valist (instance=0x15724a0, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffed54845f0) at ../gobject/gsignal.c:3406
#68 0x00007f967fccead3 in g_signal_emit (instance=instance@entry=0x15724a0, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553
#69 0x00007f9684f32ab4 in gtk_widget_event_internal (widget=0x15724a0 [BrowserWindow], event=0x16750d0) at ../gtk/gtkwidget.c:7808
#70 0x00007f9684f35892 in gtk_widget_event_internal (event=<optimized out>, widget=<optimized out>) at ../gtk/gtkwidget.c:7687
#71 gtk_widget_event (widget=<optimized out>, event=<optimized out>) at ../gtk/gtkwidget.c:7378
#72 0x0000000000000001 in  ()
#73 0x00000000016750d0 in  ()
#74 0x0000000001651020 in  ()
--Type <RET> for more, q to quit, c to continue without paging--
#75 0x0000000000000000 in  ()
Comment 1 Philippe Normand 2021-07-24 03:25:05 PDT
Created attachment 434164 [details]
Patch
Comment 2 EWS Watchlist 2021-07-24 03:25:59 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 EWS 2021-07-26 00:48:52 PDT
Committed r280291 (239949@main): <https://commits.webkit.org/239949@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434164 [details].
Comment 4 Radar WebKit Bug Importer 2021-07-26 00:49:16 PDT
<rdar://problem/81093648>
Comment 5 Carlos Garcia Campos 2021-08-03 08:08:03 PDT
I'm not sure this is the right fix. We don't manually disconnect other clients because WebPageProxy does that for us in ::close(). Maybe we can just move the resetState() call in WebPageProxy::close() after the clients are reset.
Comment 6 Carlos Garcia Campos 2021-08-15 23:18:40 PDT
(In reply to Carlos Garcia Campos from comment #5)
> I'm not sure this is the right fix. We don't manually disconnect other
> clients because WebPageProxy does that for us in ::close(). Maybe we can
> just move the resetState() call in WebPageProxy::close() after the clients
> are reset.

Could you check this Phil?
Comment 7 Philippe Normand 2021-08-16 03:29:31 PDT
.
Comment 8 Philippe Normand 2021-08-16 03:31:43 PDT
Created attachment 435582 [details]
Patch
Comment 9 EWS 2021-08-16 06:33:59 PDT
Committed r281076 (240536@main): <https://commits.webkit.org/240536@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435582 [details].