Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e05f64d91daff6fa89cd3e630a65dad791da84f2
      
https://github.com/WebKit/WebKit/commit/e05f64d91daff6fa89cd3e630a65dad791da84f2
  Author: Dan Blackwell <[email protected]>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    M Source/bmalloc/bmalloc/BCompiler.h
    M Source/bmalloc/bmalloc/BPlatform.h

  Log Message:
  -----------
  [TSan] bmalloc: fall through to system allocator under ThreadSanitizer
https://bugs.webkit.org/show_bug.cgi?id=313440

Reviewed by Marcus Plutowski.

libpas manages memory directly via mmap without going through
malloc/free, so TSan never sees the happens-before edges between
an object's last free and its next allocation, and reports every
allocator-recycled slot as a use-after-free race. Under TSan,
force BUSE_SYSTEM_MALLOC so the libpas allocator is bypassed
entirely and TSan can track allocation lifetimes through the
system allocator.

Add BTSAN_ENABLED macro to BCompiler.h (matching the existing
BASAN_ENABLED pattern), then gate BUSE_SYSTEM_MALLOC on it in
BPlatform.h. This cascades through the existing preprocessor
logic: BUSE_SYSTEM_MALLOC=1 disables BENABLE_LIBPAS, which in
turn disables BUSE_LIBPAS, BUSE_TZONE, and BENABLE_MTE.

No behaviour change in non-TSan builds.

* Source/bmalloc/bmalloc/BCompiler.h:
* Source/bmalloc/bmalloc/BPlatform.h:

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



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

Reply via email to