webgl crashes (reproducible in SandCastle)

I have been experiencing webgl crashes lately. After substituting the unminified code, I discovered that it was crashing with an array out of bounds in function updateFrustums(near, far, farToNearRatio, numFrustums, frustumCommandsList) {}.

An error occurred while rendering. Rendering has stopped.

RangeError: Invalid array length

RangeError: Invalid array length

at updateFrustums (http://localhost:8080/cesium/ray/Cesium/Cesium.js:145105:36)

at createPotentiallyVisibleSet (http://localhost:8080/cesium/ray/Cesium/Cesium.js:145256:13)

at render (http://localhost:8080/cesium/ray/Cesium/Cesium.js:145775:9)

at Scene.render (http://localhost:8080/cesium/ray/Cesium/Cesium.js:145815:13)

at CesiumWidget.render (http://localhost:8080/cesium/ray/Cesium/Cesium.js:155958:25)

at render (http://localhost:8080/cesium/ray/Cesium/Cesium.js:155374:32)

Then I launched the Cesium Inspector from our application and crashed it by inspecting the frustrums. This was different, and may provide a clue below. I can also launch the Cesium Inspector from the SandCastle and generate the crash below by clicking the Show Frustums checkbox twice (on, off, on again - crash!).

An error occurred while rendering. Rendering has stopped.

RuntimeError: Program failed to link. Link log: Cannot use both gl_FragColor and gl_FragData in the same fragment shader.


at new RuntimeError (http://cesiumjs.org/Cesium/Source/Core/RuntimeError.js:42:19)

at createAndLinkProgram (http://cesiumjs.org/Cesium/Source/Renderer/ShaderProgram.js:181:19)

at initialize (http://cesiumjs.org/Cesium/Source/Renderer/ShaderProgram.js:367:23)

at ShaderProgram._bind (http://cesiumjs.org/Cesium/Source/Renderer/ShaderProgram.js:384:9)

at beginDraw (http://cesiumjs.org/Cesium/Source/Renderer/Context.js:1805:12)

at Context.draw (http://cesiumjs.org/Cesium/Source/Renderer/Context.js:1867:9)

at DrawCommand.execute (http://cesiumjs.org/Cesium/Source/Renderer/DrawCommand.js:196:17)

at executeDebugCommand (http://cesiumjs.org/Cesium/Source/Scene/Scene.js:1155:21)

at executeCommand (http://cesiumjs.org/Cesium/Source/Scene/Scene.js:1172:13)

at executeTranslucentCommandsSortedMRT (http://cesiumjs.org/Cesium/Source/Scene/OIT.js:491:13)

I am using Windows7, and last week when running separate Java IDE and Javascript IDE, the system “complained” about colors slowing the system down, and recommended simpler color option which I accepted. Could this be related to the gl_FragColor above?

Further SandCastle testing among different clients corroborates the problem and appears to eliminate any workstation-specific color settings.

Hello Kirk,

Thanks for reporting this problem. We have an issue open for the inspector crash here: [#2448]

I’ve marked it as a ‘show stopper’. I’m not sure if your crash in updateFrustums is caused by the same error, but I’ve linked your forum post in the issue so someone can look at that as well.



The crash in updateFrustums is almost always the result of a NaN getting into a calculation somewhere. Unfortunately there’s no good way (currently) to track down the source. Typically it starts with an “undefined” value for a Cartesian x/y/z or a Cartographic lon/lat/height value. Double-check your input data.