Crash in URLSession task teardown after the app goes to the background (EXC_BAD_ACCESS _taskGroup)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #26334 @crazytonyli による — マージされずにクローズ
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 32/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- ios, objective-c, swift
- 領域
- mobile, networking
調査の方向性
Start by tracing URLSession lifecycle handling in WordPressComRestApi, WordPressOrgXMLRPCApi, WordPressOrgRestApi, TracksMini, and the invalidation call sites in Blog and WPAccount.prepareForDeletion. Try the supplied backgrounding and network-switching repro on a real iPhone, then use the suggested breakpoint to identify which session owner was deallocated. Done means confirming the cause and a fix that prevents the crash without disrupting in-flight requests.
索引モデルが issue の本文から書いたものです。
説明
Sentry: JETPACK-IOS-1H42
Sentry snapshot (as of Oct 30, 2026)
EXC_BAD_ACCESS: _taskGroup (KERN_INVALID_ADDRESS), culprit objc_retain. Fatal.
- First seen: Jul 21, 2025. Total: 1,323 events, 306 users.
- Last 30 days: 27.3: 95 events / 92 users · 27.2: 21 / 20 · 27.1: 2 · 26.8: 1.
- Not a 27.3 regression. 27.3 has about 4.2× as many users reporting any error as 27.2 (2,388 vs 573), and 92 vs 20 users is about 4.6×, so it's flat per user. It's one of the highest-volume crashes, though.
- Devices: iPhone only. All of the top 9 device models are iPhones (iPhone 12 to 18 families). OS: iOS 26.5 to 27.2, mostly 26.6.x.
Stack
The crash is on a GCD worker thread, not the main thread, with no first-party frames. Reading from the crash upward:
objc_retain ← -[NSURLSessionTask session] ← -[__NSCFLocalSessionTask localSession] ← -[__NSCFLocalSessionTask dealloc] ← URLProtocol::~URLProtocol (CFNetwork) ← … nw_quic_connection / nw_proxy_deallocate_options releases ← nw_connection_report_state_with_handler_on_nw_queue ← -[NWConcrete_nw_path_evaluator dealloc] ← nw_association_schedule_deactivation.
So _taskGroup here is an internal CFNetwork / Network.framework symbol, not a Swift concurrency TaskGroup. A URLSessionTask is being deallocated as its HTTP/3 (QUIC) connection is torn down, and it reaches back to an NSURLSession that has already been freed.
Breadcrumbs (4 recent 27.3 events)
- 3 of 4: the app comes to the foreground, the usual sync burst runs (dashboard, notifications, stats), and then the app goes to the background. The last request is a Tracks
POST /rest/v1.1/tracks/recordsent at the moment of backgrounding. The crash follows 3–6 seconds after backgrounding (in_foreground: falseon the event). - 1 of 4: the app is in the foreground in the legacy editor (
EditPostViewController›GutenbergViewController), about 40 seconds after a Tracks POST.
Candidate code (hypotheses, not confirmed)
- A URLSession invalidated or released while a task is in flight.
WordPressComRestApi.deinit,WordPressOrgXMLRPCApi,WordPressOrgRestApiand TracksMini all callfinishTasksAndInvalidate()indeinit, andinvalidateAndCancelTasks()is called fromBlogandWPAccount.prepareForDeletion. There are about 55 call sites that build a freshWordPressComRestApi(defaultV2Api(...)etc.), so throwaway clients whose session dies with in-flight requests are common. - The Tracks flush at background time (AutomatticTracks
TracksService) racing app suspension. It's the last network activity in 3 of 4 events. - An Apple CFNetwork/QUIC bug in task teardown on iOS 26. If so, the possible workaround is to keep sessions alive longer, or to disable HTTP/3 (
assumesHTTP3Capable/ per-request.http3off) to test the theory.
Repro to try
The simulator is unlikely to reproduce this: it's a race with real network teardown and app suspension, and it's iPhone-only in the field. Use a real iPhone on iOS 26.6 with Zombie Objects and Address Sanitizer on.
- Open My Site › Home (Activity Log card visible), then Stats. Background the app within 1–2 seconds of each sync starting. Repeat 20 or more times.
- Do the same with the network switching between Wi-Fi and cellular, which triggers
nw_path_evaluatorchanges. - With a breakpoint on
-[__NSCFLocalSessionTask dealloc], check which session owner (theWordPressComRestApiinstance or Tracks) has already been deallocated.
Representative events
a176cbbc020e466ca52334c3c3b6dd7a · ad97a69731f7440396da6b13d184fb2d · c55ae3f868154198b0d7779e37bd3d8c · 3fe3d324e5244341984ba573ce20143a (editor, foreground) · a37a74a7cd674193adf5543d20aa424f
Generated by Claude Code
- 主要言語
- Swift
- スター
- 3.9k
- フォーク
- 1.2k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 136
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wordpress-mobile/WordPress-iOS のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
wordpress-mobile/WordPress-iOS#26423 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wordpress-mobile/WordPress-iOS#26279 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug Share Extension
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
wordpress-mobile/WordPress-iOS#26276 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug Blogging Prompts Notifications
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
wordpress-mobile/WordPress-iOS#26256 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Status] Ready for Dev [Type] Bug Reader
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
wordpress-mobile/WordPress-iOS#26254 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
wordpress-mobile/WordPress-iOS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
🎉 Add RemoteCrabオープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
jaywcjlove/awesome-mac#4999 ·
メンテナーはふだん 1 日以内に返信
-
[Type] Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
wordpress-mobile/GutenbergKit#940 ·
メンテナーはふだん 1 日以内に返信
-
pending-maintainer-response pending-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws-amplify/amplify-swift#4423 ·
メンテナーはふだん 2 日以内に返信
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
erkamyaman/unslop-anything#80 ·
メンテナーはふだん 1 日以内に返信