Who: Tule Technologies
When: June 2019

Tule Technologies released a new firmware version, but noticed a critical problem during a limited deployment of the new software: data was being reported to the serve with a date 149 days in the past. Tule identified that a memory fault was occurring, but could not identify the root cause.

We investigated the issue and narrowed it down to a specific optimization in the -Os group of optimizations:

-fipa-icf

Perform Identical Code Folding for functions and read-only variables. The optimization reduces code size and may disturb unwind stacks by replacing a function by equivalent one with a different name.

The optimization works more effectively with link-time optimization enabled. This flag is enabled by default at -O2 and -Os.

The erroneous code met the requirements for this optimization, which resulted in unexpected program behavior. We reported this problem and resolved the error by changing the compiler flags for the project.

To conclude the project, we audited the rest of the firmware for any other likely problems and reported our findings to the team.

Testimonial

You did a great job on our recent work with you. We also enjoyed working with you. We would like to work with you more in the future on unexpected issues and planned development projects.

Adrian Cowham, CTO
Categories: Project