WebKit Bugzilla
Attachment 348436 Details for
Bug 189070
: lldb-webkit: KeyError thrown for OptionSet with invalid value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189070-20180829151201.patch (text/plain), 2.79 KB, created by
Daniel Bates
on 2018-08-29 15:12:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-08-29 15:12:02 PDT
Size:
2.79 KB
patch
obsolete
>Subversion Revision: 235481 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8567aa4be6c6fb165718b79d4a57660909f71e6f..054a9a96958ce90eb62761547848c52f97fd1669 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,23 @@ >+2018-08-29 Daniel Bates <dabates@apple.com> >+ >+ lldb-webkit: KeyError thrown for uninitialized OptionSet >+ https://bugs.webkit.org/show_bug.cgi?id=189070 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Do not compute what enumerators are in an uninitialized OptionSet. A local OptionSet variable >+ is only considered initialized when execution passes over its assignment regardless of whether >+ the variable is in scope. >+ >+ The LLDB Python API does not provide a way to determine whether an variable is initialized. >+ So, we use a simple heuristic: when the value of the OptionSet is greater than the value >+ of the bitmask with all enumerators set then we consider the OptionSet to be garbage (i.e. >+ uninitialized memory). When the variable is finally initialized LLDB will notify us to update >+ our state. >+ >+ * lldb/lldb_webkit.py: >+ (WTFOptionSetProvider.update): >+ > 2018-08-29 Chris Dumez <cdumez@apple.com> > > [PSON] We should only process-swap when eTLD+1 changes on navigation >diff --git a/Tools/lldb/lldb_webkit.py b/Tools/lldb/lldb_webkit.py >index 44d77bb5a76b930c5ddc786bc89f57aadf0f0d06..f4e1e2b9ca8a110868ba2a61bb376cfecedb168b 100644 >--- a/Tools/lldb/lldb_webkit.py >+++ b/Tools/lldb/lldb_webkit.py >@@ -612,16 +612,23 @@ class WTFOptionSetProvider: > return None > > def update(self): >- self.storage = self.valobj.GetChildMemberWithName('m_storage') >+ self.storage = self.valobj.GetChildMemberWithName('m_storage') # May be uninitialized memory >+ self._elements = [] >+ self.size = 0 > > template_argument_sbType = self.valobj.GetType().GetTemplateArgumentType(0) > enumerator_value_to_name_map = {sbTypeEnumMember.GetValueAsUnsigned(): sbTypeEnumMember.GetName() for sbTypeEnumMember in template_argument_sbType.get_enum_members_array()} > if not enumerator_value_to_name_map: > return > >+ bitmask_with_all_options_set = sum(enumerator_value_to_name_map) >+ bitmask = self.storage.GetValueAsUnsigned(0) >+ if bitmask > bitmask_with_all_options_set: >+ return # self.valobj is uninitialized memory >+ >+ # self.valobj looks like it contains a valid value. > # Iterate from least significant bit to most significant bit. > elements = [] >- bitmask = self.storage.GetValueAsUnsigned(0) > while bitmask > 0: > current = bitmask & -bitmask # Isolate the rightmost set bit. > elements.append((enumerator_value_to_name_map[current], current)) # e.g. ('Spelling', 4)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189070
:
348363
| 348436