Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 361024dd33d218850fd65617d11732aa155d2d78
      
https://github.com/WebKit/WebKit/commit/361024dd33d218850fd65617d11732aa155d2d78
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2025-04-29 (Tue, 29 Apr 2025)

  Changed paths:
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm

  Log Message:
  -----------
  http/tests/pdf/linearized-pdf-in-iframe.html is crashing at 
WTF::Lock::assertIsOwner() under PDFPluginBase::streamedBytesForDebugLogging()
https://bugs.webkit.org/show_bug.cgi?id=287012
rdar://144058653

Reviewed by Wenson Hsieh.

In 289647@main, we added PDFPluginBase::streamedBytesForDebugLogging(),
a debug-only logging utility used to read the streamed bytes count from
the plugin. This utility either tries to adopt the data lock for the
streamed bytes value or it asserts that the lock is already held before
reading it. However, this assertion was misguided because you can
imagine an incrementalLoaderLog() caller off the main thread holding
the data lock. In that case, neither can we adopt the lock, nor should
we claim that the main thread (where incrementalLoaderLog() executes)
already holds the lock. This leads to a web process crash in some debug
configurations under streamedBytesForDebugLogging().

In this patch, we fix this crash by correcting our misguided assumption.
We do so abandoning our effort to read the streamed bytes count if the
lock is not adoptable (or held). This is fine because at worst, we do not
get the streamed bytes count in a log statement, at least we do not get
in the way of correctness.

To facilitate this "do not read streamed bytes count if the lock is not
adoptable or not already held" approach, we change the return type of
PDFPluginBase::streamedBytesForDebugLogging() an optional value. We then
adopt this change in callers (namely `verboseLog()`).

* LayoutTests/platform/mac-wk2/TestExpectations:

  Adjust test expectations for previously gardened tests.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::verboseLog):
(WebKit::PDFPluginBase::incrementalLoaderLog):
(WebKit::PDFPluginBase::incrementalLoaderLogWithBytes):

Canonical link: https://commits.webkit.org/294270@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to