mapbox / mapbox/mapbox-gl-js

Out of memory crash

Open
#12,029 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: needs investigation :mag:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

mapbox-gl-js version: 2.8.2

browser: FF

Steps to Trigger Behavior

I haven't fully narrowed this down, but it's completely consistent and reproducible at my end. The cause was some bad mbtiles served locally.

The TileJSON looked like this:

{
  "basename": "SRA_PS_Current_Base.mbtiles",
  "id": "SRA_PS_Current_Base",
  "filesize": 24576,
  "scheme": "xyz",
  "name": "Untitled",
  "center": [
    -122.444,
    37.7908,
    12
  ],
  "bounds": [
    -180,
    -85.0511,
    180,
    85.0511
  ],
  "format": "png",
  "minzoom": 0,
  "maxzoom": null,
  "tiles": [
    "http://localhost:4001/tiles/SRA_PS_Current_Base/{z}/{x}/{y}.png"
  ],
  "tilejson": "2.0.0"
}

Call addSource as normal, the tileJSON is fetched without issue. Then call addLayer to add a line feature. The browser locks up, and eventually:

2022-06-22 11_11_45-Re_ SchoolScape _ Mismatching IDs for DDF processing (#76) - stevage@gmail com -

I speculate that maybe the maxzoom: null is at fault here.

(I do not anticipate doing further, unpaid, work to help create a repro case. Good luck.)

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 reproducing the reported sequence with the supplied TileJSON: call addSource, then addLayer for a line feature in Firefox. Investigate how the null maxzoom and locally served mbtiles are handled during tile loading. Done means identifying and preventing the out-of-memory lockup, with the behavior covered by a regression test if the project has an appropriate test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-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.