Bug 248250

Summary: [GLIB] Uninitialized memory use in RemoteInspector::listingForInspectionTarget
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Michael Catanzaro 2022-11-22 17:04:12 PST
Something is wrong in RemoteInspector:

==436677== Conditional jump or move depends on uninitialised value(s)
==436677==    at 0xADF8BBE: Inspector::RemoteInspector::listingForInspectionTarget(Inspector::RemoteInspectionTarget const&) const (RemoteInspectorGlib.cpp:173)
==436677==    by 0xADF8F62: Inspector::RemoteInspector::listingForTarget(Inspector::RemoteControllableTarget const&) const (RemoteInspector.cpp:220)
==436677==    by 0xADFCD02: Inspector::RemoteInspector::registerTarget(Inspector::RemoteControllableTarget*) (RemoteInspector.cpp:74)
==436677==    by 0xB1FEA85: JSC::JSGlobalObject::init(JSC::VM&) (JSGlobalObject.cpp:798)
==436677==    by 0xB206A2D: JSC::JSGlobalObject::finishCreation(JSC::VM&) (JSGlobalObject.cpp:2998)
==436677==    by 0xA51B695: create (JSAPIGlobalObject.h:51)
==436677==    by 0xA51B695: JSGlobalContextCreateInGroup (JSContextRef.cpp:142)
==436677==    by 0xA4A85E1: jscContextSetVirtualMachine(_JSCContext*, WTF::GRefPtr<_JSCVirtualMachine>&&) (JSCContext.cpp:110)
==436677==    by 0xA4ABC4B: jscContextConstructed(_GObject*) (JSCContext.cpp:156)
==436677==    by 0x4A1249C: g_object_new_internal (gobject.c:2279)
==436677==    by 0x4A12870: g_object_new_with_properties (gobject.c:2391)
==436677==    by 0x4A11D37: g_object_new (gobject.c:2037)
==436677==    by 0x6CCAC42: ensureContext (APISerializedScriptValueGLib.cpp:60)
==436677==    by 0x6CCAC42: API::SerializedScriptValue::sharedJSCContext() (APISerializedScriptValueGLib.cpp:94)
==436677==  Uninitialised value was created by a heap allocation
==436677==    at 0x484286F: malloc (vg_replace_malloc.c:393)
==436677==    by 0xB6B9A2F: pas_debug_heap_allocate (pas_debug_heap.h:101)
==436677==    by 0xB6B9A2F: pas_try_allocate_intrinsic_impl_casual_case (pas_try_allocate_intrinsic.h:104)
==436677==    by 0xB6B9A2F: bmalloc_allocate_impl_casual_case.constprop.0 (bmalloc_heap_inlines.h:70)
==436677==    by 0xB6B9CE8: bmalloc_allocate_casual (bmalloc_heap.c:64)
==436677==    by 0xB1FEA28: operator new (JSGlobalObjectDebuggable.h:43)
==436677==    by 0xB1FEA28: make_unique<JSC::JSGlobalObjectDebuggable, JSC::JSGlobalObject&> (unique_ptr.h:1065)
==436677==    by 0xB1FEA28: makeUnique<JSC::JSGlobalObjectDebuggable, JSC::JSGlobalObject&> (StdLibExtras.h:539)
==436677==    by 0xB1FEA28: JSC::JSGlobalObject::init(JSC::VM&) (JSGlobalObject.cpp:797)
==436677==    by 0xB206A2D: JSC::JSGlobalObject::finishCreation(JSC::VM&) (JSGlobalObject.cpp:2998)
==436677==    by 0xA51B695: create (JSAPIGlobalObject.h:51)
==436677==    by 0xA51B695: JSGlobalContextCreateInGroup (JSContextRef.cpp:142)
==436677==    by 0xA4A85E1: jscContextSetVirtualMachine(_JSCContext*, WTF::GRefPtr<_JSCVirtualMachine>&&) (JSCContext.cpp:110)
==436677==    by 0xA4ABC4B: jscContextConstructed(_GObject*) (JSCContext.cpp:156)
==436677==    by 0x4A1249C: g_object_new_internal (gobject.c:2279)
==436677==    by 0x4A12870: g_object_new_with_properties (gobject.c:2391)
==436677==    by 0x4A11D37: g_object_new (gobject.c:2037)
==436677==    by 0x6CCAC42: ensureContext (APISerializedScriptValueGLib.cpp:60)
==436677==    by 0x6CCAC42: API::SerializedScriptValue::sharedJSCContext() (APISerializedScriptValueGLib.cpp:94)
Comment 1 Michael Catanzaro 2022-11-23 15:46:17 PST
I assumed this happened always when starting WebKit, but I can't reproduce it anymore today. :S