Add debug logging for failed WebEngineHistory deserialization

This sometimes fails with 'The data stream has read past the end of the data in
the underlying device', which turns up in crash reports around once a month.

This is somewhat similar to https://bugreports.qt.io/browse/QTBUG-117489 - but
without knowing the data and without being able to reproduce, it's unclear what
the culprit could be.
This commit is contained in:
Florian Bruhin 2025-05-14 08:47:08 +02:00
parent 9c7a75616c
commit 9447182809
1 changed files with 8 additions and 1 deletions

View File

@ -626,7 +626,14 @@ class WebEngineHistoryPrivate(browsertab.AbstractHistoryPrivate):
return data
def deserialize(self, data):
qtutils.deserialize(data, self._history)
try:
qtutils.deserialize(data, self._history)
except OSError:
dump = "\n".join(
bytes(line).hex(" ") for line in utils.chunk(bytes(data), 16)
)
log.webview.debug(f"Failed to deserialize history data:\n{dump}")
raise
def _load_items_workaround(self, items):
"""WORKAROUND for session loading not working on Qt 5.15.