<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>312617</bug_id>
          
          <creation_ts>2026-04-17 17:41:58 -0700</creation_ts>
          <short_desc>[CMake][ASan] Sandbox profiles preprocessed without -fsanitize, blocking SYS_sigaltstack in WebContent/GPU</short_desc>
          <delta_ts>2026-04-17 23:27:56 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CMake</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Lewis">simon.lewis</reporter>
          <assigned_to name="Simon Lewis">simon.lewis</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2201713</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Lewis">simon.lewis</who>
    <bug_when>2026-04-17 17:41:58 -0700</bug_when>
    <thetext>The macOS sandbox profiles (com.apple.WebProcess.sb.in,
  com.apple.WebKit.GPUProcess.sb.in, ...) gate ASan-required syscalls behind
      #if ASAN_ENABLED
          SYS_sigaltstack
      #endif

  where ASAN_ENABLED is derived in wtf/Compiler.h from
  __has_feature(address_sanitizer).

  DerivedSources.make passes $(SANITIZE_FLAGS) (= -fsanitize=address) to the
  clang -E invocation that preprocesses .sb.in -&gt; .sb, so the gate opens in
  Xcode ASan builds. The CMake equivalent in
  Source/WebKit/PlatformMac.cmake (WEBKIT_DEFINE_XPC_SERVICES) does not pass
  any -fsanitize flag, so the mac-asan preset (added in 312514@main) produces
  non-ASan sandbox profiles.

  Symptom: launching MiniBrowser from a mac-asan build, the WebContent
  process aborts the first time Security.framework throws a C++ exception:

      AddressSanitizer: CHECK failed: asan_posix.cpp:45
        &quot;((0)) == ((sigaltstack(nullptr, &amp;signal_stack)))&quot; (0x0, 0xffffffffffffffff)
      ...
      #3  __asan::PlatformUnpoisonStacks()
      #4  __asan_handle_no_return
      #5  __cxa_throw  (ASan interceptor)
      #6  Security::UnixError::throwMe
      ...
      #17 WebKit::WebProcess::platformInitializeWebProcess

  sigaltstack(NULL, &amp;oss) returns -1/EPERM because SYS_sigaltstack is not in
  the syscall allowlist.

  Fix: append -fsanitize=&lt;each ENABLE_SANITIZERS entry&gt; to the .sb.in
  preprocessing flags in PlatformMac.cmake, mirroring DerivedSources.make.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2201714</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Lewis">simon.lewis</who>
    <bug_when>2026-04-17 17:49:15 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/63015</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2201797</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-17 23:27:54 -0700</bug_when>
    <thetext>Committed 311517@main (9ed0cbc96b8b): &lt;https://commits.webkit.org/311517@main&gt;

Reviewed commits have been landed. Closing PR #63015 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>