Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode variation selectors (U-FE00 to U-FE0F) in Label text freeze Cesium #4918

Closed
xtassin opened this issue Jan 25, 2017 · 8 comments
Closed

Comments

@xtassin
Copy link
Contributor

xtassin commented Jan 25, 2017

Using a unicode character and a variation selector (U-FE00 to U-FE0F) as label's text gets Cesium in an infinite loop (CPU maxed and frozen browser)

I could reproduce this in FireFox and Chrome but not IE or MS Edge (do not appear to support variation selectors)

This character: (\u2620) will work fine
It's variation: ☠️ (\u2620\ufe0f) will crash Cesium

Firebug pointed me to mesureText.js (line 173) that looks like a good candidate for the buggy loop.

Here is the stack trace:

measureText@https://cesiumjs.org/Cesium/Source/ThirdParty/measureText.js:173:19
writeTextToCanvas@https://cesiumjs.org/Cesium/Source/Core/writeTextToCanvas.js:89:25
createGlyphCanvas@https://cesiumjs.org/Cesium/Source/Scene/LabelCollection.js:99:15
rebindAllGlyphs@https://cesiumjs.org/Cesium/Source/Scene/LabelCollection.js:202:29
LabelCollection.prototype.update@https://cesiumjs.org/Cesium/Source/Scene/LabelCollection.js:778:16
EntityCluster.prototype.update@https://cesiumjs.org/Cesium/Source/DataSources/EntityCluster.js:727:12
PrimitiveCollection.prototype.update@https://cesiumjs.org/Cesium/Source/Scene/PrimitiveCollection.js:366:12
updatePrimitives@https://cesiumjs.org/Cesium/Source/Scene/Scene.js:2196:8
executeCommandsInViewport@https://cesiumjs.org/Cesium/Source/Scene/Scene.js:2106:8
updateAndExecuteCommands@https://cesiumjs.org/Cesium/Source/Scene/Scene.js:1974:16
render@https://cesiumjs.org/Cesium/Source/Scene/Scene.js:2404:8
Scene.prototype.render@https://cesiumjs.org/Cesium/Source/Scene/Scene.js:2442:12
CesiumWidget.prototype.render@https://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:687:12
render@https://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:72:24

@hpinkos
Copy link
Contributor

hpinkos commented Jan 25, 2017

Related: #378

@hpinkos
Copy link
Contributor

hpinkos commented Feb 16, 2017

@ggetz
Copy link
Contributor

ggetz commented Jan 24, 2018

@glathoud
Copy link
Contributor

glathoud commented Jan 9, 2019

Same issue with the soft hyphen U+00AD (sandcastle example).

@glathoud
Copy link
Contributor

#378 is pretty old now... Until it gets solved, would it be thinkable to filter out the most problematic Unicode codepoints before rendering, e.g. U+FE00 to U-FE0F, and U+00AD ?

@mramato
Copy link
Contributor

mramato commented Jan 10, 2019

I'm hoping this will be addressed by #7280, but we need to find the time to review and test it.

@mramato
Copy link
Contributor

mramato commented Nov 1, 2019

Can confirm that this is fixed in master (and in today's 1.63 release I'm publishing now).

@mramato mramato closed this as completed Nov 1, 2019
@cesium-concierge
Copy link

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

https://groups.google.com/forum/?hl=en#!topic/cesium-dev/UgdiI_MNbTQ
https://groups.google.com/forum/#!topic/cesium-dev/sfE8_8dUfXI

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

The issue at #4918 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants