mapbox / mapbox/mapbox-scenekit

Crash in MBImageAPI

Open
#34 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
232
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Crash happens when trying to fetch a larger map size.

MapboxImageAPI.swift line 227:

group.notify(queue: DispatchQueue.main) {
self.pendingFetches.removeValue(forKey: groupID)
completion(!hadFailure ? imageBuilder.makeImage() : nil) // HERE: EXC_BAD_ACCESS (code=2
}

what later affects:

terrainNode.fetchTerrainTexture("mapbox/satellite-v9", zoom: 14, progress: { _, _ in }, completion: { image in
terrainNode.geometry?.materials[4].diffuse.contents = image // here
})

In the console I receive tons of following informations:
`2018-08-28 13:46:51.938021+0200 AppName[1937:978808] [Unknown process name] CGBitmapContextInfoCreate: unable to allocate 608605984 bytes for bitmap data`

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 with MapboxImageAPI.swift around line 227 and reproduce the crash while fetching the larger map size. Trace imageBuilder.makeImage() and the terrainNode.fetchTerrainTexture completion, then verify that the larger request no longer crashes and the terrain texture receives an image.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.