You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR for #5389 introduced a new global object for the unencrypted message counter. This c++ object is initialized at global scope with a pseudorandom number from rand(). In this case, rand() is supplied by the newlib-nano standard library. This implementation of rand() is meant to be reentrant, so it calls the FreeRTOS function to get the reent struct. Which ends up attempting to alloc memory for the new reent struct. The system heap is not setup on the TI platform until main, causing a hard fault.
Proposed Solution
Eclipsing the stdlib implementation of rand() and srand() is the simplest change. A basic non-reentrant function will work for the PRNG assumption here. The TRNG and DRBG can be fulfilled by other sources where needed.
The text was updated successfully, but these errors were encountered:
Problem
The PR for #5389 introduced a new global object for the unencrypted message counter. This c++ object is initialized at global scope with a pseudorandom number from
rand()
. In this case,rand()
is supplied by thenewlib-nano
standard library. This implementation ofrand()
is meant to be reentrant, so it calls the FreeRTOS function to get the reent struct. Which ends up attempting to alloc memory for the new reent struct. The system heap is not setup on the TI platform untilmain
, causing a hard fault.Proposed Solution
Eclipsing the stdlib implementation of
rand()
andsrand()
is the simplest change. A basic non-reentrant function will work for the PRNG assumption here. The TRNG and DRBG can be fulfilled by other sources where needed.The text was updated successfully, but these errors were encountered: