<?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>313950</bug_id>
          
          <creation_ts>2026-05-03 20:48:36 -0700</creation_ts>
          <short_desc>[Cocoa] Crash in WeakPtr&lt;PlatformSpeechSynthesizer&gt;::get() under -[WebSpeechSynthesisWrapper availableVoicesDidChange]</short_desc>
          <delta_ts>2026-05-04 07:30:47 -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>Accessibility</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>InRadar, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>andresg_22</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2207076</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-05-03 20:48:36 -0700</bug_when>
    <thetext>AVFoundation&apos;s `VoiceDatabaseClient.startCacheInvalidation()` now posts `AVSpeechSynthesisAvailableVoicesDidChangeNotification` from a background Swift concurrency cooperative thread rather than the main thread.  `-[WebSpeechSynthesisWrapper availableVoicesDidChange]` dereferences its `WeakPtr&lt;PlatformSpeechSynthesizer&gt;` directly in the notification handler, tripping the `WeakPtr` threading assertion (`ASSERT_WITH_SECURITY_IMPLICATION(canSafelyBeUsed())`) and crashing the UI process.

Stack trace:
```
Thread 18 Crashed::  Dispatch queue: com.apple.root.default-qos.cooperative:
0   JavaScriptCore:  WTFCrashWithSecurityImplication
1   WebCore:  WTF::WeakPtr&lt;WebCore::PlatformSpeechSynthesizer&gt;::get() const
2   WebCore:  -[WebSpeechSynthesisWrapper availableVoicesDidChange]
3   CoreFoundation:  __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
4   CoreFoundation:  ___CFXRegistrationPost_block_invoke
5   CoreFoundation:  _CFXRegistrationPost
6   CoreFoundation:  _CFXNotificationPost
7   Foundation:  -[NSNotificationCenter postNotificationName:object:userInfo:]
8   TextToSpeech:  closure #1 in VoiceDatabaseClient.startCacheInvalidation()
9   libswift_Concurrency.dylib:  completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*)
```

The regression is an AVFoundation behavior change, not a WebKit commit regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207077</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-05-03 20:48:38 -0700</bug_when>
    <thetext>&lt;rdar://problem/173555693&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207079</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-05-03 20:53:03 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64144</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207185</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-04 07:30:45 -0700</bug_when>
    <thetext>Committed 312522@main (28838f616b1d): &lt;https://commits.webkit.org/312522@main&gt;

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

    </bug>

</bugzilla>