lvgl / lv_demos

Examples, tutorials and applications for the LVGL embedded GUI library
https://lvgl.io
492 stars 366 forks source link

Hardfault (IntegerDivideByZero) on demo stress when using UNSCII 8 font. #75

Closed C47D closed 4 years ago

C47D commented 4 years ago

Hi,

This issue was found while working on the lv_esp32_port repo. The hardfault seems to be triggered when using symbols with the unscii 8 font set as default (the project had all the 4 font types set to unscii 8). See here for more details.

Can symbols be used on unscii 8 font? the hardfault gets triggered with the wifi symbol.

I report this here because I think it can be sorted out on the demo code, transfer to lvgl main repo if you think it's more appropiate.

kisvegabor commented 4 years ago

Hi,

There are no symbols in unscii8 because the FontAwesome fonts (the font used as symbols) have no monochrome version.

C47D commented 4 years ago

I see, how can we solve it? Explicitly state that on the demo readme, exit the faulty function if the divisor is 0, check the font at runtime and display the demo without symbols?

I can make a PR with the solution if you want me to.

kisvegabor commented 4 years ago

I've added a fix to return if any size is zero.

I think we can leave the demo as it is. At worst case, the symbol will be silently ignored. A warning is probably also added about the missing symbol.

stale[bot] commented 4 years ago

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.