Bug 213899 - [Flatpak SDK][WPE] Launching the remote inspector kills MB
Summary: [Flatpak SDK][WPE] Launching the remote inspector kills MB
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: 2020-07-02 13:09 PDT by Sergio Villar Senin
Modified: 2020-09-16 14:12 PDT (History)
12 users (show)

See Also:


Attachments
Patch (2.56 KB, patch)
2020-07-08 01:25 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 Sergio Villar Senin 2020-07-02 13:09:07 PDT
This is the error I get, seems like the code is trying to access files outside the sandbox:


Error loading libWPEWebInspectorResources.so: /usr/local/lib/wpe-webkit-1.0/libWPEWebInspectorResources.so: cannot open shared object file: No such file or directory

(MiniBrowser:24): GLib-CRITICAL **: 13:04:56.972: g_bytes_get_data: assertion 'bytes != NULL' failed
(MiniBrowser:24): GLib-CRITICAL **: 13:04:56.973: g_bytes_get_data: assertion 'bytes != NULL' failed
(MiniBrowser:24): GLib-CRITICAL **: 13:04:56.973: g_variant_new_bytestring: assertion 'string != NULL' failed
(MiniBrowser:24): GLib-CRITICAL **: 13:04:56.973: g_variant_get_type: assertion 'value != NULL' failed
(MiniBrowser:24): GLib-CRITICAL **: 13:04:56.974: g_variant_type_is_subtype_of: assertion 'g_variant_type_check (type)' failed
(MiniBrowser:24): GLib-CRITICAL **: 13:04:56.974: g_variant_get_type_string: assertion 'value != NULL' failed
(MiniBrowser:24): GLib-ERROR **: 13:04:56.974: g_variant_new: expected GVariant of type 'ay' but received value has type '(null)'

ScriptError raised: Failed to run "[u'/app/webkit/WebKitBuild/Release/bin/MiniBrowser', 'https://immersive-web.github.io/webxr-samples/']" exit_code: -5 cwd: /app/webkit
Traceback (most recent call last):
  File "/app/webkit/Tools/Scripts/webkitpy/minibrowser/run_webkit_app.py", line 59, in main
    return port.run_minibrowser(args)
  File "/app/webkit/Tools/Scripts/webkitpy/port/wpe.py", line 146, in run_minibrowser
    return self._executive.run_command(command + args, cwd=self.webkit_base(), stdout=None, return_stderr=False, decode_output=False)
  File "/app/webkit/Tools/Scripts/webkitpy/common/system/executive.py", line 435, in run_command
    (error_handler or self.default_error_handler)(script_error)
  File "/app/webkit/Tools/Scripts/webkitpy/common/system/abstractexecutive.py", line 97, in default_error_handler
    raise error
ScriptError: Failed to run "[u'/app/webkit/WebKitBuild/Release/bin/MiniBrowser', 'https://immersive-web.github.io/webxr-samples/']" exit_code: -5 cwd: /app/webkit
Comment 1 Philippe Normand 2020-07-02 13:29:18 PDT
Oh yeah I saw a similar error today. But I think in GTK it works. Need to debug... :)
Comment 2 Philippe Normand 2020-07-03 02:16:59 PDT
This fails in Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp where I suspect we might need to check an env-var additionally to the build-time hardcoded lib path.
Comment 3 Philippe Normand 2020-07-03 02:19:16 PDT
It works fine in GTK because the inspector commands are loaded from a GResource embedded in the lib.
Comment 4 Philippe Normand 2020-07-08 01:25:47 PDT
Created attachment 403766 [details]
Patch
Comment 5 Philippe Normand 2020-07-08 01:26:44 PDT
Comment on attachment 403766 [details]
Patch

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

> Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp:49
> +        const char* path = g_getenv("WEBKIT_INJECTED_BUNDLE_PATH");

I was lazy here. I can a new variable if the reviewer kindly asks :)
Comment 6 Adrian Perez 2020-09-16 13:55:28 PDT
Comment on attachment 403766 [details]
Patch

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

>> Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorUtils.cpp:49
>> +        const char* path = g_getenv("WEBKIT_INJECTED_BUNDLE_PATH");
> 
> I was lazy here. I can a new variable if the reviewer kindly asks :)

As this is going to be used only for developer builds, I think it is okay
to reuse this variable that is already being set by all our scripts instead
of introducing a new one which would need handling in many places.
Comment 7 EWS 2020-09-16 14:11:12 PDT
Committed r267159: <https://trac.webkit.org/changeset/267159>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 403766 [details].
Comment 8 Radar WebKit Bug Importer 2020-09-16 14:12:17 PDT
<rdar://problem/69013637>