CesiumGS / CesiumGS/cesium

RangeError: invalid array length while using an external source for terrain tiles

Open
#9,174 3 comments 0 reactions 0 assignees View on GitHub
category - terrain and imagery type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

I'm experiencing the following error in both Firefox 80.0.1 on Ubuntu 18.04 and Brave browser 1.14.84:

```
An error occurred while rendering. Rendering has stopped.

RangeError: invalid array length

updateFrustums@http://localhost:1338/Build/Cesium/Cesium.js:1:2877049
View.prototype.createPotentiallyVisibleSet@http://localhost:1338/Build/Cesium/Cesium.js:1:2879945
executeCommandsInViewport@http://localhost:1338/Build/Cesium/Cesium.js:1:3063988
Scene.prototype.updateAndExecuteCommands@http://localhost:1338/Build/Cesium/Cesium.js:1:3061280
render@http://localhost:1338/Build/Cesium/Cesium.js:1:3073789
tryAndCatchError@http://localhost:1338/Build/Cesium/Cesium.js:1:3074027
Scene.prototype.render@http://localhost:1338/Build/Cesium/Cesium.js:1:3075886
CesiumWidget.prototype.render@http://localhost:1338/Build/Cesium/Cesium.js:1:3323706
e@http://localhost:1338/Build/Cesium/Cesium.js:1:3309560
FrameRequestCallback*requestAnimationFramePolyFill@http://localhost:1338/Build/Cesium/Cesium.js:1:810846
e@http://localhost:1338/Build/Cesium/Cesium.js:1:3309570
FrameRequestCallback*requestAnimationFramePolyFill@http://localhost:1338/Build/Cesium/Cesium.js:1:810846
e@http://localhost:1338/Build/Cesium/Cesium.js:1:3309570
FrameRequestCallback*requestAnimationFramePolyFill@http://localhost:1338/Build/Cesium/Cesium.js:1:810846
e@http://localhost:1338/Build/Cesium/Cesium.js:1:3309570
FrameRequestCallback*requestAnimationFramePolyFill@http://localhost:1338/Build/Cesium/Cesium.js:1:810846
e@http://localhost:1338/Build/Cesium/Cesium.js:1:3309570
FrameRequestCallback*requestAnimationFramePolyFill@http://localhost:1338/Build/Cesium/Cesium.js:1:810846
(...)
```

This error only happens when I simply move around close to the terrain (shift or rotation).

I tried with a minimalist example, using only a simple viewer. This allowed my to notice that this bug only happens when I'm using an external [terrain source](https://3d.geo.admin.ch/1.0.0/ch.swisstopo.terrain.3d/default/20200520/4326/layer.json), as documented here; https://api3.geo.admin.ch/services/sdiservices.html

I'm using it like this:
```
terrainProvider: new Cesium.CesiumTerrainProvider({
url : '//3d.geo.admin.ch/1.0.0/ch.swisstopo.terrain.3d/default/20200520/4326/'
})
```
Rights are granted. The terrain seems to load perfectly. No errors show in the console during the loading time. The crash only appears when I start moving.

Thanks for your help.

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with a minimalist viewer using CesiumTerrainProvider and the linked external terrain URL, then inspect the updateFrustums and View.prototype.createPotentiallyVisibleSet stack entries in Build/Cesium/Cesium.js. Done means moving or rotating near the terrain no longer stops rendering with a RangeError: invalid array length.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.