[webkit-changes] [WebKit/WebKit] 06235d: [libpas] PGM does not respect alignment

Yusuke Suzuki noreply at github.com
Fri Jan 31 15:13:28 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 06235d829da16c4218a606419b3044ab2b11adf2
      https://github.com/WebKit/WebKit/commit/06235d829da16c4218a606419b3044ab2b11adf2
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2025-01-31 (Fri, 31 Jan 2025)

  Changed paths:
    M Source/bmalloc/libpas/src/libpas/pas_enumerate_large_heaps.c
    M Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c
    M Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.h
    M Source/bmalloc/libpas/src/libpas/pas_report_crash.c
    M Source/bmalloc/libpas/src/libpas/pas_report_crash.h
    M Source/bmalloc/libpas/src/libpas/pas_try_allocate_common.h
    M Source/bmalloc/libpas/src/libpas/pas_try_reallocate.h
    M Source/bmalloc/libpas/src/test/EnumerationTests.cpp
    M Source/bmalloc/libpas/src/test/PGMTests.cpp

  Log Message:
  -----------
  [libpas] PGM does not respect alignment
https://bugs.webkit.org/show_bug.cgi?id=286708
rdar://143847878

Reviewed by Mark Lam.

PGM code is ignoring user-specified alignment. This does not work at all
since the user expects aligned allocations but PGM returns unrelated
pointers. This patch wires alignment correctly to PGM and fixes address
computation.

We also fixed PGMTests.cpp as it cannot be compiled. Also fixes so many
style issues around PGM code.

* Source/bmalloc/libpas/src/libpas/pas_enumerate_large_heaps.c:
(pas_hash_map_entry_callback):
* Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c:
(pas_probabilistic_guard_malloc_allocate):
(pas_probabilistic_guard_malloc_deallocate):
(pas_probabilistic_guard_malloc_check_exists):
(pas_probabilistic_guard_malloc_return_as_large_map_entry):
(pas_probabilistic_guard_malloc_debug_info):
* Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.h:
* Source/bmalloc/libpas/src/libpas/pas_report_crash.c:
(memory_reader_adapter):
(setup_memory_reader):
(pas_update_report_crash_fields):
(pas_report_crash_extract_pgm_failure):
* Source/bmalloc/libpas/src/libpas/pas_report_crash.h:
* Source/bmalloc/libpas/src/libpas/pas_try_allocate_common.h:
(pas_try_allocate_pgm):
(pas_try_allocate_common_impl_slow):
* Source/bmalloc/libpas/src/libpas/pas_try_reallocate.h:
(pas_try_reallocate):
* Source/bmalloc/libpas/src/test/EnumerationTests.cpp:
(std::testPGMEnumerationBasic):
(std::testPGMEnumerationAddAndFree):
* Source/bmalloc/libpas/src/test/PGMTests.cpp:
(std::testPGMSingleAlloc):
(std::testPGMMultipleAlloc):
(std::testPGMAlignedAlloc):
(std::testPGMRealloc):
(std::testPGMMetaData):
(std::testPGMErrors):
(std::testPGMMetadataVectorManagement):
(std::testPGMMetadataVectorManagementFewDeallocations):
(std::testPGMMetadataDoubleFreeBehavior):
(std::testPGMMetadataVectorManagementRehash):
(addPGMTests):

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



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


More information about the webkit-changes mailing list