Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

[Bug]: iOS abort in geocoding_darwin Pigeon reply encoding after registrar deallocation

Ouverte
#327 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
49/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
dart, flutter, swift

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Please check the following before submitting a new issue.
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:

  1. Start a geocoding request and delay its completion.
  2. Detach the plugin from the Flutter engine.
  3. Deliver the pending completion.
  4. 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

https://github.com/Baseflow/flutter-geocoding/blob/cd7c13c84de45291c21ed5930f3d0941706d302a/geocoding_darwin/darwin/geocoding_darwin/Sources/geocoding_darwin/GeocodingDarwinPlugin.swift#L27-L30

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.

geocoding-sanitized-crash.txt

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

Langage dominant
Dart
Étoiles
153
Forks
92
Merge moyen
7 j 21 h
PR mergées (30 j)
3

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Baseflow/flutter-geocoding

Toutes les issues de Baseflow/flutter-geocoding

Issues similaires

Plus d'issues Dart

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.