Bug 189585 - [GLib] Fix format string in KeyedEncoderGlib::beginObject().
Summary: [GLib] Fix format string in KeyedEncoderGlib::beginObject().
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ms2ger (he/him; ⌚ UTC+1/+2)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-13 07:25 PDT by Ms2ger (he/him; ⌚ UTC+1/+2)
Modified: 2018-09-13 12:08 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.74 KB, patch)
2018-09-13 07:27 PDT, Ms2ger (he/him; ⌚ UTC+1/+2)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ms2ger (he/him; ⌚ UTC+1/+2) 2018-09-13 07:25:44 PDT
We are hitting the following assertion during layout tests:

GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed

with the stack

g_variant_builder_add () at /home/slave/webkitgtk/gtk-linux-64-debug-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gvariant.c:5531
(anonymous namespace)::KeyedEncoderGlib::encodeBool (this=0x7fdcd4001aa0, key="wasDataRead", value=false) at ../../Source/WebCore/platform/glib/KeyedEncoderGlib.cpp:61
(anonymous namespace)::<lambda(WebCore::KeyedEncoder&, const WebCore::CanvasActivityRecord&)>::operator()((anonymous namespace)::KeyedEncoder &, const (anonymous namespace)::CanvasActivityRecord &) const (__closure=0x7fdcf7ffe10f, encoderInner=..., canvasActivityRecord=...) at ../../Source/WebCore/loader/ResourceLoadStatistics.cpp:86
(anonymous namespace)::KeyedEncoder::encodeObject<WebCore::CanvasActivityRecord, WebCore::encodeCanvasActivityRecord(WebCore::KeyedEncoder&, const WTF::String&, const WebCore::CanvasActivityRecord&)::<lambda(WebCore::KeyedEncoder&, const WebCore::CanvasActivityRecord&)> >(const WTF::String &, const (anonymous namespace)::CanvasActivityRecord &, <unknown type in /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37, CU 0x0, DIE 0x28e67f>) (this=0x7fdcd4001aa0, key="canvasActivityRecord", object=..., function=<unknown type in /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37, CU 0x0, DIE 0x28e67f>) at ../../Source/WebCore/platform/KeyedCoding.h:175
(anonymous namespace)::encodeCanvasActivityRecord (encoder=..., label="canvasActivityRecord", canvasActivityRecord=...) at ../../Source/WebCore/loader/ResourceLoadStatistics.cpp:90
Comment 1 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-09-13 07:27:32 PDT
Created attachment 349664 [details]
Patch
Comment 2 Michael Catanzaro 2018-09-13 08:15:46 PDT
Comment on attachment 349664 [details]
Patch

I had to stare at this for a while to convince myself it should be different from KeyedEncoderGlib::beginArray, but I think the change is correct.

But surely this changes the database serialization format. How do we fix existing databases that are already broken? Will the critical continue to occur forever for existing broken databases? That requires further investigation. Hopefully we have some mechanism somewhere to handle incompatible changes like this? I'd like Carlos to review this, please.
Comment 3 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-09-13 08:56:34 PDT
This method is not used in the IDB case, only for ResourceLoadStatistics, as I understand it. I don't think that serializes to disk? (This is why it's only come up since r235897.)
Comment 4 Michael Catanzaro 2018-09-13 11:03:54 PDT
Comment on attachment 349664 [details]
Patch

OK then

It *does* serialize to disk, but we have not yet enabled resource load statistics for GTK or WPE (we need to) so doesn't matter.
Comment 5 Michael Catanzaro 2018-09-13 11:05:07 PDT
Of course, there's another problem here: this code should not be running at all, because resource load statistics should never be enabled.
Comment 6 Michael Catanzaro 2018-09-13 11:06:05 PDT
BTW this was added for database process, years before resource load statistics existed, so I'm a bit surprised it's only used for resource load statistics nowadays.
Comment 7 WebKit Commit Bot 2018-09-13 12:08:54 PDT
Comment on attachment 349664 [details]
Patch

Clearing flags on attachment: 349664

Committed r235982: <https://trac.webkit.org/changeset/235982>
Comment 8 WebKit Commit Bot 2018-09-13 12:08:56 PDT
All reviewed patches have been landed.  Closing bug.