question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cesium crashes in old versions of Chrome and Firefox

See original GitHub issue

Cesium crashes in browsers with old versions of ANGLE when using D3D9, since Cesium 1.50.

atmospherecolor issue pic

This happens to me on Windows 10 x64, with Chrome 59 after disabling D3D11.

GL_RENDERER: ANGLE (NVIDIA GeForce 940MX Direct3D9Ex vs_3_0 ps_3_0)

GL_VERSION: OpenGL ES 2.0 (ANGLE 2.1.0.a9042d3c1952)

It’s caused by an old ANGLE bug triggered by this line in GroundAtmosphere.glsl:

float fLightAngle = useSunLighting ? dot(czm_sunDirectionWC, v3Pos) / length(v3Pos) : 1.0;

which was added in Cesium 1.50. On my machine, the above line is translated to the HLSL code: (with my comments)

{
bool s6 = _webgl_38a54cf7838b624e; // _webgl_38a54cf7838b624e is useSunLighting
if (s6)
{
(s3 = (dot(_webgl_fa5fcdcb25e91339, _webgl_fa0dc18b0c5cfc1c) / length(_webgl_fa0dc18b0c5cfc1c)));
}
else
{
if ((!s6))
{
(s3 = 1.0);
}
else
{
return (webgl_cd16f13802bc8948)0; // webgl_cd16f13802bc8948 is the AtmosphereColor constructor, notice it's missing a "_" prefix
}

The last else section isn’t even needed but seems to be a workaround to an HLSL error, see this ANGLE commit for more details. This workaround appends a dummy return value, whose type is taken from the current function’s return type. But due to a bug in ANGLE, if the current function’s return type is a custom struct (like AtmosphereColor in our case) then the constructor of the dummy value isn’t prefixed with a “_”, and so it causes an undefined identifier error and a program linking failure. This bug was fixed, but it still affects old versions of Chrome and Firefox.

This seems to be the same issue mentioned in the forum: https://groups.google.com/forum/#!topic/cesium-dev/okbIEFu5Hcw, regarding Firefox.

On my machine I can simply use a newer version of Chrome and that will solve the problem, but I’ve encountered it also on other standalone devices with old chrome versions.

Two possible simple workarounds that have worked for me are:

  1. Make the computeGroundAtmosphereFromSpace function a void type with an AtmosphereColor out argument.
  2. Instead of using a ternary operator, use mix().

I’ll be glad to open a pull request.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hodbauercommented, Mar 20, 2019

This issue happend to my customer too. He have for some reasons old version of chrome. The solution that we use to solve it is:

var globe = new Cesium.Globe();
globe.showGroundAtmosphere = false;
var viewer = new Cesium.Viewer('cesiumContainer', { globe: globe });

I know that it’s less beautiful, but it works.

0reactions
cesium-conciergecommented, May 24, 2019

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/forum/#!topic/cesium-dev/okbIEFu5Hcw](https

If this issue affects any of these threads, please post a comment like the following:

The issue at https://github.com/AnalyticalGraphicsInc/cesium/issues/7472 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cesium crashes in old versions of Chrome and Firefox #7472
This bug was fixed, but it still affects old versions of Chrome and Firefox. This seems to be the same issue mentioned in...
Read more >
Cesium crashes browser tab and sometimes computer
Safari: Works fine Chrome and Firefox: Kills tab and sometimes causes ... the past for older Cesium versions without running into any issues....
Read more >
Chrome Aw Snap, Firefox out of memory when using cesium ...
Even with current Cesium & Chrome version (Windows 10 64 bit), this situation seems to occur. Chrome crashes with "Aw snap!" about once...
Read more >
Browser(Chrome and Firefox) running out of Memory when ...
I ran the code locally in both Firefox and Chrome. Both are experiencing this error after between 30 and 300 runs depending on...
Read more >
Cross-Origin Request Blocked despite CORS header set to ...
Assets in our mapping application fail to load from assets.cesium.com. Console error says: Cross-Origin Request Blocked: The Same Origin Policy disallows ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found