[Webkit-unassigned] [Bug 193826] New: [WPE] Inspector server crashes because libWPEWebInspectorResources.so is looked up in an installed location

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 25 08:47:00 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=193826

            Bug ID: 193826
           Summary: [WPE] Inspector server crashes because
                    libWPEWebInspectorResources.so is looked up in an
                    installed location
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit WPE
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cturner at igalia.com
                CC: bugs-noreply at webkitgtk.org

Using trunk WPE, I run a WPE minibrowser like so,

% WEBKIT_INSPECTOR_SERVER='localhost:9998' run-minibrowser --wpe --debug

And then connect to it from Epiphany 3.30.2 I see a crash, the backtrace is attached for completeness,

#0  WTFCrash () at ../../Source/WTF/wtf/Assertions.cpp:255
#1  0x00007f3a3ab2e5ec in _ZN9Inspector15backendCommandsEv () at ../../Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp:54
#2  0x00007f3a3ab2e678 in _ZN9Inspector19backendCommandsHashEv () at ../../Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp:62
#3  0x00007f3a3ab1bb0d in _ZN9Inspector21RemoteInspectorServer20setupInspectorClientEP16_GDBusConnectionPKc (
    this=0x7f3a406025c0 <_ZZN9Inspector21RemoteInspectorServer9singletonEvE6server>, clientConnection=0x243c790, 
    clientBackendCommandsHash=0x7f39b400a2f0 "01F73C9BE6930FD0F80D63D575FA3C703BA803AC")
    at ../../Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorServer.cpp:277
#4  0x00007f3a3ab1ac6b in Inspector::RemoteInspectorServer::<lambda(GDBusConnection*, const gchar*, const gchar*, const gchar*, const gchar*, GVariant*, GDBusMethodInvocation*, gpointer)>::operator()(GDBusConnection *, const gchar *, const gchar *, const gchar *, const gchar *, GVariant *, GDBusMethodInvocation *, gpointer) const (__closure=0x0, connection=0x243c790, methodName=0x7f39b4009190 "SetupInspectorClient", parameters=0x7f39b0003d80, 
    invocation=0x243f1c0, userData=0x7f3a406025c0 <_ZZN9Inspector21RemoteInspectorServer9singletonEvE6server>)
    at ../../Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorServer.cpp:120
#5  0x00007f3a3ab1b0f2 in Inspector::RemoteInspectorServer::<lambda(GDBusConnection*, const gchar*, const gchar*, const gchar*, const gchar*, GVariant*, GDBusMethodInvocation*, gpointer)>::_FUN(GDBusConnection *, const gchar *, const gchar *, const gchar *, const gchar *, GVariant *, GDBusMethodInvocation *, gpointer) () at ../../Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorServer.cpp:156
#6  0x00007f3a2b279bf9 in call_in_idle_cb (user_data=<optimized out>) at ../../Source/glib-2.58.1/gio/gdbusconnection.c:4842
#7  0x00007f3a2b05c998 in g_main_dispatch (context=0x204c190) at ../../Source/glib-2.58.1/glib/gmain.c:3182
#8  g_main_context_dispatch (context=context at entry=0x204c190) at ../../Source/glib-2.58.1/glib/gmain.c:3847
#9  0x00007f3a2b05cd58 in g_main_context_iterate (context=0x204c190, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>)
    at ../../Source/glib-2.58.1/glib/gmain.c:3920
#10 0x00007f3a2b05d042 in g_main_loop_run (loop=0x204c6e0) at ../../Source/glib-2.58.1/glib/gmain.c:4116
#11 0x000000000040dcca in main (argc=1, argv=0x7ffee2141348) at ../../Tools/MiniBrowser/wpe/main.cpp:203


The problematic function in RemoteInspectorUtils.cpp:54 is like this,

GRefPtr<GBytes> backendCommands()
{
#if PLATFORM(WPE)
    static std::once_flag flag;
    std::call_once(flag, [] {
        GModule* resourcesModule = g_module_open(PKGLIBDIR G_DIR_SEPARATOR_S "libWPEWebInspectorResources.so", G_MODULE_BIND_LAZY);
        if (!resourcesModule) {
            WTFLogAlways("Error loading libWPEWebInspectorResources.so: %s", g_module_error());
            return;
        }

        g_module_make_resident(resourcesModule);
    });
#endif
    GRefPtr<GBytes> bytes = adoptGRef(g_resources_lookup_data(INSPECTOR_BACKEND_COMMANDS_PATH, G_RESOURCE_LOOKUP_FLAGS_NONE, nullptr));
    ASSERT(bytes);
    return bytes;
}

Here, g_resources_lookup_data returns a nullptr, which causes the crash.

After discussing with Adrian offline about this, some options are,

 1) Provide an env var with a location to the libWPEWebInspectorResources.so file in the WebKitBuild dir
 2) Move the path information into a gresources file

As a workaround, I tried creating a symlink to the WebKitBuild directory from the assumed system-wide install dir like so,

'/usr/local/lib64/wpe-webkit-0.1/libWPEWebInspectorResources.so' -> '/home/cturner/webkit/webkit-wpe/WebKitBuild/Debug/lib/libWPEWebInspectorResources.so'

Then a crash is not observed, but I get instead a Connection reset by peer,

RemoteInspector failed to connect to inspector server at: localhost:9998: Error receiving data: Connection reset by peer

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190125/918c1807/attachment-0001.html>


More information about the webkit-unassigned mailing list