Crash in Blog.xmlrpcApi when saving a post that was deleted locally (EXC_BAD_ACCESS at 0x48, since 27.2)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with PostRepository.swift (_sync, _create, and getRemoteService) and trace how a deleted post reaches Blog.swift's xmlrpcApi getter, checking the related PostServiceRemoteFactory.swift call. Build the Jetpack scheme and follow the reproduction steps using docs/simulator-sign-in.md; done means reporting whether the crash reproduces and, if confirmed, what the investigation establishes about the deleted post and blog.
由索引模型根据 Issue 内容生成。
描述
Likely shares a root cause with #26316, #26317, #26319, #26320. See #26323: posts are deleted locally by a first-page list sync while still in use.
Sentry: JETPACK-IOS-1KJC
Sentry snapshot (as of Oct 30, 2026)
Fatal EXC_BAD_ACCESS: KERN_INVALID_ADDRESS at 0x48. It was first seen Aug 31, 2026, the 27.2 release; Sentry's suspect commit is the release/27.2 merge (#25916). Totals: 114 events from 79 users.
| Last 30 days | Events | Users |
|---|---|---|
| 27.3 | 62 | 41 |
| 27.2 | 7 | 7 |
27.3 has about 4.2× as many error-reporting users as 27.2, so 41 against 7 (about 5.9×) is slightly rising. All events are on iPhone, on iOS 26.5 to 27.2. Some users crash repeatedly.
Stack
PostRepository._create (PostRepository.swift:222) → getRemoteService(for: post.blog) (:393) → PostServiceRemoteFactory.forBlog (PostServiceRemoteFactory.swift:14) → Blog.xmlrpcApi.getter (Blog.swift:81) → URL? → crash.
Blog.swift:81 is if _xmlrpcApiEndpoint != endpoint, which reads a Swift stored property. Reading address 0x48 means self is nil: that's a field offset from a nil pointer.
Why it started in 27.2 (hypothesis)
- The 27.2 change. #25869 (in 27.2) added the
_xmlrpcApiEndpointcache, a Swift stored property read inside thexmlrpcApigetter. - How a nil blog reaches it.
post.blogis declared non-optional (@NSManaged public var blog: Blog), but Core Data returns nil for it when the post has been deleted. Objective-C calls on a nil blog, likesupports(.wpComRESTAPI)andwordPressComRestApi, silently return NO/nil, soforBlogfalls through toblog.xmlrpcApi. - Before and after. Before 27.2, that getter didn't touch Swift storage, so a nil blog probably came back as
nilandPostRepositorythrewremoteAPIUnavailable. Now it crashes. - Why it's
_create. A deleted post also readspostIDas nil, so_synctakes the create path.
Breadcrumbs (3 events sampled)
Every time, the crash comes right after the user commits a change to a post they opened earlier:
- Editor → Close → alert → Update (
publishButtonTapped) - Post Settings opened from Posts search → Cancel → alert → Done
- Posts search → editor → Close → Move to Trash alert
- In all three the app went to the background and came back while the post was open, and Posts list syncs ran in between.
- Two of the three started from Posts search (
status=any,trashresults).
Candidate code (hypothesis)
- Same cause as #26317. The post was deleted locally, by a list sync or a trash, while the editor or Post Settings still held it.
- Fix direction:
- In
PostRepository._sync,_createandgetRemoteService, guardpost.managedObjectContext != nil && !post.isDeleted. - Make
forBlogandxmlrpcApisafe against a deleted or nil blog.
- In
Repro to try
- Sign in to a self-hosted site with an application password, or to any site where
forBlogreachesxmlrpcApi. Use a site with several published posts. - Posts → Search → open a result in the editor, or in Post Settings.
- Delete the post locally while it's open: trash it on the web and pull to refresh the Posts list, or background the app long enough for a list sync to purge it.
- Tap Update, or Done in Post Settings.
- Pass:
EXC_BAD_ACCESSinBlog.xmlrpcApi, or a breakpoint in_createshowingpost.isDeleted == trueandpost.blog == nil.
Events
af200e41c91a4ffe86ff64f393dd5d25dd1b9b7460a84a048da50d1f7e64d6bcc1ac90b2a8de4ec3bed82e4261ace77f223ecf228a864eaa9a6510c29461b7d3bf039188011e41eaac00138c1d995844
Build the Jetpack scheme and sign in using docs/simulator-sign-in.md, with bundle ID com.automattic.jetpack.
When you're done: post the results here. If you now have reliable steps, remove [Status] Needs Repro. If you found the cause and a fix approach, remove [Status] Needs Plan and add [Status] Ready for Dev. Remove Simulator Testable when you're finished.
Generated by Claude Code
- 主要语言
- Swift
- 星标
- 3.9k
- 派生
- 1.2k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 136
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
-
Optional callbacks log "Unable to create JSCallback" when passed null可能已有人在做 @cmsj 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
cmsj/Hammerspoon2#464 ·
-
android bug
难度 2/5 1-3 小时 新手友好度 76/100
VocaHQ/vocaphone#470 · 1 条评论 ·
维护者通常 1 天内回复
-
new-compilers request
难度 2/5 1-3 小时 新手友好度 65/100
compiler-explorer/compiler-explorer#9640 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
bug
难度 2/5 1-3 小时 新手友好度 74/100