Bug 171207 - [GTK] Web Inspector: crashes on every page
Summary: [GTK] Web Inspector: crashes on every page
Status: RESOLVED DUPLICATE of bug 167991
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-23 17:09 PDT by dirk.fizzlebeef
Modified: 2018-07-25 13:47 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dirk.fizzlebeef 2017-04-23 17:09:35 PDT
Every time I attempt to open the web inspector on any page, it shows an error page that begins with "Web Inspector encountered an internal error" and throws this error in the console: 

    (midori4:27162): Gtk-WARNING **: Allocating size to WebKitWebViewBase 0x10f8700 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? 

I asked about this in the #midori channel on Freenode and was told it's a regression in WebKit GTK, so I'm opening the bug here instead of there.
Comment 1 dirk.fizzlebeef 2017-04-23 17:10:18 PDT
Oh yeah, this is in version 2.16.1.
Comment 2 Michael Catanzaro 2017-04-23 17:52:16 PDT
Note that GTK+ warning is irrelevant and not causing this problem.

The web inspector is working fine here with 2.16.1. I'm actually not sure how to debug this, considering it probably can't inspect itself if it's always failing like this....
Comment 3 Sergey Mende 2017-12-01 01:15:06 PST
The problem lies in the discrepancy between LANG environment variable format and  https://www.rfc-editor.org/rfc/bcp/bcp47.txt spec.

The Web Inspector does not cause an internal error if LANG is set to a simple two characters language code, i.e.:

    env LANG="en" midori

works just fine. 

As soon as LANG is set to a full spec, e.g. "en_US.UTF-8", the Web Inspector fails to open with the following message in its pane:

TypeError:​ failed to initialize NumberFormat due to invalid locale (at Utilities.js:​801:​57)​
    NumberFormat @ [native code]​
    toLocaleString @ [native code]​
    d @ Utilities.js:​801:​57
    value @ Utilities.js:​881:​64
    value @ Utilities.js:​899:​29
    _loadNewRecording @ TimelineManager.js:​655:​108
    reset @ TimelineManager.js:​114:​31
    TimelineManager @ TimelineManager.js:​62:​19
    loaded @ Main.js:​130:​50
    global code @ Main.html:​808:​18


I am using stock FC26's package (webkitgtk4-2.18.3-1.fc26.x86_64)
Comment 4 Michael Catanzaro 2017-12-01 07:15:06 PST
Interesting. It works for me using en_US.UTF-8.
Comment 5 Sergey Mende 2017-12-01 11:24:21 PST
(In reply to Michael Catanzaro from comment #4)
> Interesting. It works for me using en_US.UTF-8.

Michael,

If you give me a hint where the source requests process locale then I could trace the problem: the code is quite huge, so my quick attempt to locate it has failed.

Sergey
Comment 6 Michael Catanzaro 2017-12-01 12:49:53 PST
I did some grepping and found Source/JavaScriptCore/runtime/IntlNumberFormat.cpp. The failure is occurring in IntlNumberFormat::initializeNumberFormat. I would look closely at resolveLocale in IntlObject.cpp. If you're able to rebuild WebKit, adding printfs is by far the easiest way to debug a problem like this. Good luck!
Comment 7 Michael Catanzaro 2018-07-25 13:47:01 PDT

*** This bug has been marked as a duplicate of bug 167991 ***