mapbox / mapbox/mapbox-maps-ios

SDK Crash : DefaultLocationProvider.swift - Attempted to read an unowned reference but object was already deallocated

Open
#2,172 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Xcode version: Compiled with 15.0
- iOS version: 17.4.1
- Devices affected: iPhone 12
- Maps SDK Version: Attached in the following screenshot 👇🏻
image

## Observed behavior and steps to reproduce

- Just play with the SDK using the `SearchEngine` feature. The crash has only occurred for 1 user so far. It hasn't happened frequently enough to be significant... _(For now)_

## Expected behavior
No crash. Should use `weak` or handle the `unowned` references in a proper way.

## Additional links and references
image
image
image
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading DefaultLocationProvider.swift and tracing how the SearchEngine feature creates and uses its references. Use the reported Xcode, iOS, device, and SDK context to investigate the intermittent deallocation crash. Done means the affected lifecycle no longer produces the unowned-reference crash and the relevant behavior is covered by an appropriate check.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.