Bug 193721 - [GTK] Crash when browsing inspector:// uri without port set
Summary: [GTK] Crash when browsing inspector:// uri without port set
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-23 08:08 PST by Philippe Normand
Modified: 2019-01-23 09:38 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.72 KB, patch)
2019-01-23 08:11 PST, Philippe Normand
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2019-01-23 08:08:54 PST
run-minibrowser --gtk --debug inspector://127.0.0.1

(gdb) bt
#0  WTFCrash () at ../../Source/WTF/wtf/Assertions.cpp:255
#1  0x00007f71e88ee48b in _ZNO3WTF8OptionalItE5valueEv (this=0x7fff4be02f0c) at DerivedSources/ForwardingHeaders/wtf/Optional.h:547
#2  0x00007f71e88ecacb in WebKit::RemoteInspectorProtocolHandler::<lambda()>::operator()(void) const (__closure=0x7fff4be03350)
    at ../../Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:112
#3  0x00007f71e88ed8e1 in WTF::HashMapEnsureTranslator<WTF::HashMap<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient> >::KeyValuePairTraits, WTF::StringHash>::translate<WTF::KeyValuePair<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient> >, WTF::String, WebKit::RemoteInspectorProtocolHandler::handleRequest(WebKitURISchemeRequest*)::<lambda()> >(WTF::KeyValuePair<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> > > &, WTF::String &&, WebKit::RemoteInspectorProtocolHandler::<lambda()> &&) (location=..., key=..., functor=...)
    at DerivedSources/ForwardingHeaders/wtf/HashMap.h:208
#4  0x00007f71e88ed801 in WTF::HashTable<WTF::String, WTF::KeyValuePair<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> > > >, WTF::StringHash, WTF::HashMap<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient> >::KeyValuePairTraits, WTF::HashTraits<WTF::String> >::add<WTF::HashMapEnsureTranslator<WTF::HashMap<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient> >::KeyValuePairTraits, WTF::StringHash>, WTF::String, WebKit::RemoteInspectorProtocolHandler::handleRequest(WebKitURISchemeRequest*)::<lambda()> >(WTF::String &&, WebKit::RemoteInspectorProtocolHandler::<lambda()> &&) (this=0x7f71d22e3098, 
    key=..., extra=...) at DerivedSources/ForwardingHeaders/wtf/HashTable.h:949
#5  0x00007f71e88ed5bb in WTF::HashMap<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> >, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> > > >::inlineEnsure<WTF::String, WebKit::RemoteInspectorProtocolHandler::handleRequest(WebKitURISchemeRequest*)::<lambda()> >(WTF::String &&, WebKit::RemoteInspectorProtocolHandler::<lambda()> &&) (this=0x7f71d22e3098, key=..., functor=...) at DerivedSources/ForwardingHeaders/wtf/HashMap.h:355
#6  0x00007f71e88ed560 in WTF::HashMap<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> >, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> > > >::ensure<WebKit::RemoteInspectorProtocolHandler::handleRequest(WebKitURISchemeRequest*)::<lambda()> >(WTF::HashMap<WTF::String, std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> >, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<std::unique_ptr<WebKit::RemoteInspectorClient, std::default_delete<WebKit::RemoteInspectorClient> > > >::KeyType &&, WebKit::RemoteInspectorProtocolHandler::<lambda()> &&) (this=0x7f71d22e3098, key=..., functor=...)
    at DerivedSources/ForwardingHeaders/wtf/HashMap.h:418
#7  0x00007f71e88eceb7 in _ZN6WebKit30RemoteInspectorProtocolHandler13handleRequestEP23_WebKitURISchemeRequest (this=0x7f71d22e3088, request=0x55f9a9b4c060)
    at ../../Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:111
#8  0x00007f71e88ec6e1 in WebKit::RemoteInspectorProtocolHandler::<lambda(WebKitURISchemeRequest*, gpointer)>::operator()(WebKitURISchemeRequest *, gpointer) const (__closure=0x0, request=0x55f9a9b4c060, 
    userData=0x7f71d22e3088) at ../../Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:64
#9  0x00007f71e88ec709 in WebKit::RemoteInspectorProtocolHandler::<lambda(WebKitURISchemeRequest*, gpointer)>::_FUN(WebKitURISchemeRequest *, gpointer) ()
    at ../../Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:65
#10 0x00007f71e88b5481 in _ZN22WebKitURISchemeHandler15performCallbackEP23_WebKitURISchemeRequest (this=0x7f71d22ff5e0, request=0x55f9a9b4c060) at ../../Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp:151
#11 0x00007f71e88b46ac in _Z42webkitWebContextStartLoadingCustomProtocolP17_WebKitWebContextmRKN7WebCore15ResourceRequestERN6WebKit32LegacyCustomProtocolManagerProxyE (context=0x55f9a9c5c100, customProtocolID=1, 
    resourceRequest=..., manager=warning: can't find linker symbol for virtual table for `WebKit::LegacyCustomProtocolManagerProxy' value
warning:   found `_ZTVN6WebKit32LegacyCustomProtocolManagerProxyE' instead
...) at ../../Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp:1669
#12 0x00007f71e887b2b8 in _ZN27CustomProtocolManagerClient12startLoadingERN6WebKit32LegacyCustomProtocolManagerProxyEmRKN7WebCore15ResourceRequestE (this=0x55f9a9c5b8d0, manager=warning: can't find linker symbol for virtual table for `WebKit::LegacyCustomProtocolManagerProxy' value
warning:   found `_ZTVN6WebKit32LegacyCustomProtocolManagerProxyE' instead
..., customProtocolID=1, 
    request=...) at ../../Source/WebKit/UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp:41
#13 0x00007f71e897760c in _ZN6WebKit32LegacyCustomProtocolManagerProxy12startLoadingEmRKN7WebCore15ResourceRequestE (this=0x55f9a98fdf58, customProtocolID=1, request=...)
    at ../../Source/WebKit/UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:47
#14 0x00007f71e83af9b6 in _ZN3IPC22callMemberFunctionImplIN6WebKit32LegacyCustomProtocolManagerProxyEMS2_FvmRKN7WebCore15ResourceRequestEESt5tupleIJmS4_EEJLm0ELm1EEEEvPT_T0_OT1_St16integer_sequenceImJXspT2_EEE (
    object=0x55f9a98fdf58, function=
    (void (WebKit::LegacyCustomProtocolManagerProxy::*)(WebKit::LegacyCustomProtocolManagerProxy * const, unsigned long, const WebCore::ResourceRequest &)) 0x7f71e89775c4 <_ZN6WebKit32LegacyCustomProtocolManagerProxy12startLoadingEmRKN7WebCore15ResourceRequestE>, args=...) at ../../Source/WebKit/Platform/IPC/HandleMessage.h:41
#15 0x00007f71e83af830 in _ZN3IPC18callMemberFunctionIN6WebKit32LegacyCustomProtocolManagerProxyEMS2_FvmRKN7WebCore15ResourceRequestEESt5tupleIJmS4_EESt16integer_sequenceImJLm0ELm1EEEEEvOT1_PT_T0_ (args=..., 
    object=0x55f9a98fdf58, function=
    (void (WebKit::LegacyCustomProtocolManagerProxy::*)(WebKit::LegacyCustomProtocolManagerProxy * const, unsigned long, const WebCore::ResourceRequest &)) 0x7f71e89775c4 <_ZN6WebKit32LegacyCustomProtocolManagerProxy12startLoadingEmRKN7WebCore15ResourceRequestE>) at ../../Source/WebKit/Platform/IPC/HandleMessage.h:47
#16 0x00007f71e83af6df in _ZN3IPC13handleMessageIN8Messages32LegacyCustomProtocolManagerProxy12StartLoadingEN6WebKit32LegacyCustomProtocolManagerProxyEMS5_FvmRKN7WebCore15ResourceRequestEEEEvRNS_7DecoderEPT0_T1_
    (decoder=..., object=0x55f9a98fdf58, function=
    (void (WebKit::LegacyCustomProtocolManagerProxy::*)(WebKit::LegacyCustomProtocolManagerProxy * const, unsigned long, const WebCore::ResourceRequest &)) 0x7f71e89775c4 <_ZN6WebKit32LegacyCustomProtocolManagerProxy12startLoadingEmRKN7WebCore15ResourceRequestE>) at ../../Source/WebKit/Platform/IPC/HandleMessage.h:133
#17 0x00007f71e83af476 in _ZN6WebKit32LegacyCustomProtocolManagerProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE (this=0x55f9a98fdf58, connection=..., decoder=...)
    at DerivedSources/WebKit/LegacyCustomProtocolManagerProxyMessageReceiver.cpp:40
#18 0x00007f71e8589706 in _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE (this=0x55f9a98fde38, connection=..., decoder=...)
    at ../../Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:118
#19 0x00007f71e868d21b in _ZN6WebKit17ChildProcessProxy15dispatchMessageERN3IPC10ConnectionERNS1_7DecoderE (this=0x55f9a98fde00, connection=..., decoder=...)
    at ../../Source/WebKit/UIProcess/ChildProcessProxy.cpp:155
--Type <RET> for more, q to quit, c to continue without paging--
#20 0x00007f71e89760cd in _ZN6WebKit19NetworkProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE (this=0x55f9a98fde00, connection=..., decoder=...)
    at ../../Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:261
#21 0x00007f71e8567aff in _ZN3IPC10Connection15dispatchMessageERNS_7DecoderE (this=0x7f71d22ab1e0, decoder=...) at ../../Source/WebKit/Platform/IPC/Connection.cpp:978
#22 0x00007f71e8567c7a in _ZN3IPC10Connection15dispatchMessageESt10unique_ptrINS_7DecoderESt14default_deleteIS2_EE (this=0x7f71d22ab1e0, message=std::unique_ptr<IPC::Decoder> = {...})
    at ../../Source/WebKit/Platform/IPC/Connection.cpp:1005
#23 0x00007f71e856815e in _ZN3IPC10Connection26dispatchOneIncomingMessageEv (this=0x7f71d22ab1e0) at ../../Source/WebKit/Platform/IPC/Connection.cpp:1074
#24 0x00007f71e856784c in IPC::Connection::<lambda()>::operator()(void) (__closure=0x7f71d22a5048) at ../../Source/WebKit/Platform/IPC/Connection.cpp:956
#25 0x00007f71e856f348 in WTF::Function<void()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::unique_ptr<IPC::Decoder>)::<lambda()> >::call(void) (this=0x7f71d22a5040)
    at DerivedSources/ForwardingHeaders/wtf/Function.h:101
#26 0x00007f71e83bf4f8 in _ZNK3WTF8FunctionIFvvEEclEv (this=0x7fff4be039f8) at DerivedSources/ForwardingHeaders/wtf/Function.h:56
#27 0x00007f71dce6262d in _ZN3WTF7RunLoop11performWorkEv (this=0x7f71d22f7000) at ../../Source/WTF/wtf/RunLoop.cpp:106
#28 0x00007f71dced4460 in WTF::RunLoop::<lambda(gpointer)>::operator()(gpointer) const (__closure=0x0, userData=0x7f71d22f7000) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:68
#29 0x00007f71dced4484 in WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:70
#30 0x00007f71dced4400 in WTF::<lambda(GSource*, GSourceFunc, gpointer)>::operator()(GSource *, GSourceFunc, gpointer) const (__closure=0x0, source=0x55f9a904f260, 
    callback=0x7f71dced4467 <WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer)>, userData=0x7f71d22f7000) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:45
#31 0x00007f71dced4430 in WTF::<lambda(GSource*, GSourceFunc, gpointer)>::_FUN(GSource *, GSourceFunc, gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:46
#32 0x00007f71de82d988 in g_main_dispatch () at ../../Source/glib-2.58.1/glib/gmain.c:3182
#33 g_main_context_dispatch () at ../../Source/glib-2.58.1/glib/gmain.c:3847
#34 0x00007f71de82dd48 in g_main_context_iterate () at ../../Source/glib-2.58.1/glib/gmain.c:3920
#35 0x00007f71de82e032 in g_main_loop_run () at ../../Source/glib-2.58.1/glib/gmain.c:4116
#36 0x00007f71df006585 in gtk_main () at /home/phil/WebKit/WebKitBuild/DependenciesGTK/Source/gtk+-3.22.11/gtk/gtkmain.c:1312
#37 0x000055f9a8e7af7e in main (argc=1, argv=0x7fff4be03dc8) at ../../Tools/MiniBrowser/gtk/main.c:587
Comment 1 Philippe Normand 2019-01-23 08:11:00 PST
Created attachment 359887 [details]
Patch
Comment 2 EWS Watchlist 2019-01-23 08:12:31 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Michael Catanzaro 2019-01-23 08:21:47 PST
Comment on attachment 359887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=359887&action=review

> Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:95
>          GUniquePtr<GError> error(g_error_new_literal(WEBKIT_POLICY_ERROR, WEBKIT_POLICY_ERROR_CANNOT_SHOW_URI, "Cannot show inspector URL: no port provided"));
>          webkit_uri_scheme_request_finish_error(request, error.get());
> +        return;

D:
Comment 4 Carlos Garcia Campos 2019-01-23 09:38:39 PST
Comment on attachment 359887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=359887&action=review

>> Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:95
>> +        return;
> 
> D:

Oops.