[Bug]: iOS abort in geocoding_darwin Pigeon reply encoding after registrar deallocation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 49/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend-api-design, mobile
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Dart
- Stars
- 154
- Forks
- 94
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Baseflow/flutter-geocoding
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Baseflow/flutter-geocoding#337 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Baseflow/flutter-geocoding#332 ·
Maintainers usually reply within 1 day
-
[Bug]: `Geocoding(locale: ...)` has no effect – locale is not forwarded to `_fromPlatformCreationParams`May be free again @AmrWalidi claimed this 27 days ago, and no pull request is open. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Baseflow/flutter-geocoding#324 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Baseflow/flutter-geocoding#311 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Baseflow/flutter-geocoding#309 ·
Maintainers usually reply within 1 day
All issues in Baseflow/flutter-geocoding
Similar issues
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
VeryGoodOpenSource/vgv-ai-flutter-plugin#219 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Anxcye/anx-reader#1024 ·
-
[cloud_functions]: Apple platforms ignore custom domains passed as regionPossibly taken @ragavendranbala-TSL claimed this today. OpenNeeds Attention platform: ios platform: macos plugin: functions type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firebase/flutterfire#19015 · 2 comments ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RevenueCat/purchases-flutter#2048 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hajisensai/Fushi#4543 · 3 comments ·
Maintainers usually reply within 1 day