Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3856a285807d08daf91e57de733118285a74501b
      
https://github.com/WebKit/WebKit/commit/3856a285807d08daf91e57de733118285a74501b
  Author: Ian Grunert <[email protected]>
  Date:   2026-09-08 (Tue, 08 Sep 2026)

  Changed paths:
    M Source/WTF/wtf/win/MemoryFootprintWin.cpp

  Log Message:
  -----------
  [Win] memoryFootprint() crashes under WINE
https://bugs.webkit.org/show_bug.cgi?id=323559

Reviewed by Don Olmstead.

Wine does not implement the working set list query: QueryWorkingSet fails
with ERROR_INVALID_PARAMETER without writing the buffer, so
memoryFootprint() sized its retry buffer from uninitialized stack memory
and the huge allocation crashed every WebKit process ~30s after launch.

Compute the private working set with QueryWorkingSetEx instead, walking
committed regions with VirtualQuery and querying page attributes in fixed
size batches: bounded memory, no retry loop, and it works under Wine. The
QueryWorkingSet path is kept as a hardened fallback (NumberOfEntries only
read after ERROR_BAD_LENGTH, capped retries, tryMalloc).

Verified under Wine: dirtying 64MB of private pages moves the reported
footprint by exactly 64MB, and the browser benchmarks run to completion.

* Source/WTF/wtf/win/MemoryFootprintWin.cpp:
(WTF::memoryFootprintFromWorkingSetEx): Added.
(WTF::memoryFootprintFromWorkingSetList): Renamed from memoryFootprint.
(WTF::memoryFootprint):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to