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

Index out of range #65

Open
Arm1stice opened this issue Sep 12, 2018 · 3 comments
Open

Index out of range #65

Arm1stice opened this issue Sep 12, 2018 · 3 comments

Comments

@Arm1stice
Copy link

Arm1stice commented Sep 12, 2018

I had a panic occur in production today, this could be related to some of the bugs found in #17. It appears to stem from

dy := int16(glyf[offset])

The stack trace is attached below
chrome_2018-09-12_13-48-53

I am not sure exactly what produced this bug, and normally the function that gets run doesn't produce this error. However, this could be an indication that there needs to be some checking before assuming that the offset is a valid index?

@andydotxyz
Copy link

We see the same issue in Fyne using the Google Noto Sans fonts.
The int16() func is called with an offset that is right at the end of the array and so the +1 fails.
What I cannot fathom is why this only happens some times. In theory the font and the rendering never changes.
Recent reports seem to indicate it could be a race caused when this is called very frequently...

@rcoreilly
Copy link

I'm pretty sure that code is not thread-safe! I got a lot of random crashing due to races until adding mutexes upstream to ensure only one routine was calling at a time. it re-loads things into shared buffers I think..

@jandelgado
Copy link

I had the same problem (index errors and garbled output in a high frequence rendering scenario). It completely disappeared after making the client code thread safe by using an object pool (https://github.com/jolestar/go-commons-pool) for the font instances.

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

No branches or pull requests

4 participants