[Bug]: iOS abort in geocoding_darwin Pigeon reply encoding after registrar deallocation
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 49/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
调研方向
Read GeocodingLibrary.g.swift around line 609 and GeocodingDarwinPlugin.swift around lines 27–30, then trace the completion handlers for all three asynchronous geocoding methods. Start by checking how detach and pending replies interact; the issue describes a source-backed hypothesis but no deterministic reproducer. Done means completions remain safe across teardown while normal success and error replies still work when attached.
由索引模型根据 Issue 内容生成。
描述
Please check the following before submitting a new issue.
- I have searched the existing issues.
- I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
- Android
- iOS
Steps to reproduce
We observed a native iOS crash during completion of an asynchronous geocoding request. A sanitized symbolicated stack is attached.
We do not yet have a deterministic reproducer. The app was in the background when the crash occurred; this does not establish that backgrounding caused engine teardown.
A suspected lifecycle sequence to investigate:
- Start a geocoding request and delay its completion.
- Detach the plugin from the Flutter engine.
- Deliver the pending completion.
- Check whether reply encoding accesses the released Pigeon registrar.
This sequence is a source-backed hypothesis, not a confirmed reproduction.
Expected results
Pending geocoding completions should remain safe across plugin/engine teardown. After detach, they should not encode or send replies through a released registrar or detached engine.
Normal success and error replies should continue working while attached.
Actual results
The process terminates with EXC_CRASH (SIGABRT).
Relevant stack:
swift::swift_abortRetainUnowned
swift_unownedRetainStrong
GeocodingLibraryPigeonInternalProxyApiCodecReaderWriter.writer(with:)
GeocodingLibrary.g.swift:609
FlutterStandardMessageCodec encode:
FlutterBasicMessageChannel ... reply
PigeonApiCLGeocoder.setUpMessageHandlers(...)
CLGeocoderProxyApiDelegate.geocodeAddressString(...) completion
The immediate failure is an expired Swift unowned reference during reply encoding.
Source inspection shows:
- The codec reader/writer holds an unowned pigeonRegistrar.
- detachFromEngine sets ignoreCallsToDart, tears down handlers, then releases proxyApiRegistrar.
- Pending geocoding completion handlers invoke reply without checking registrar availability or detach state.
Relevant upstream source:
https://github.com/Baseflow/flutter-geocoding/blob/cd7c13c84de45291c21ed5930f3d0941706d302a/geocoding_darwin/darwin/geocoding_darwin/Sources/geocoding_darwin/Geocoding/GeocodingLibrary.g.swift#L608-L609
A possible fix is to guard pending completions against registrar release/detach and keep the registrar alive during reply encoding, with callback delivery serialized against teardown. All three asynchronous geocoding methods need equivalent handling.
The precise event that released the registrar in this incident remains unknown.
Code sample
The application retains a Geocoding instance and calls:
final geocoding = Geocoding();
final placemarks = await geocoding.placemarkFromCoordinates(
latitude,
longitude,
);
This usage alone is not a reproducer. The symbolicated stack names geocodeAddressString despite the application's reverse-geocoding call; that discrepancy remains unresolved.
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
geocoding 5.0.0 geocoding_darwin 1.0.3 iOS, ARM64
Flutter Doctor output
Not available
- 主要语言
- Dart
- 星标
- 153
- 派生
- 92
- 平均合并
- 7 天 21 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Baseflow/flutter-geocoding 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
Baseflow/flutter-geocoding#324 ·
-
难度 1/5 1-3 小时 新手友好度 84/100
Baseflow/flutter-geocoding#311 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Baseflow/flutter-geocoding#309 ·
-
难度 4/5 3-5 天 新手友好度 38/100
Baseflow/flutter-geocoding#287 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
Baseflow/flutter-geocoding#286 · 2 条评论 ·
查看 Baseflow/flutter-geocoding 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 4 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 3 天内回复
-
area-clientside-dartpad
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
'图片收藏'功能无法滑动未关闭
难度 2/5 1-3 小时 新手友好度 68/100
venera-app/venera-prime#50 ·