BUG: Isolines algorithm endless loop (out of memory)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
Hello,
in the attached zip file there's a very simple example (including different 2 input datasets) which causes the turf.isonlines() algorithm to loop endlessly and then be stopped by Chrome before a potential out of memory occurred.
The endless loop occurs in the turf.tracePath() function which iterates always on the same points (failing to detect a closed path) filling the 'p' array ('a' array in the minified turf version) until Chrome blocks it preventing an out of memory scenario (the 'p' or 'a' array is about 23 millions elements on my machine).
You can switch the input via the variable whichInput.
Tested on Chrome version: 80.0.3987.87 (Build official) (64 bit)
Thanks
Contributor 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.
Research direction
Start by reproducing the endless loop with the attached turf-out-of-mem.zip example and switch between datasets using whichInput. Trace turf.isolines() into turf.tracePath(), focusing on the repeated points and the growing p array described in the report. Done means both inputs terminate without unbounded memory growth.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100