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
{{ message }}
Repository navigation
fix(stl): ThreadLocalReal::access() dereferences null when pthread_key_create/setspecific fails #5310
In src/fl/stl/thread_local.h, ThreadLocalReal<T>::access() dereferences a null pointer if pthread_key_create fails (constructor) or if pthread_setspecific / the per-thread allocation fails on first access. Pre-existing; noticed while fixing #5304 (PR #5309).
Proposed solution
Check the return code of pthread_key_create; record a "key invalid" state.
In access(), if the key is invalid or pthread_setspecific fails (or allocation returns null), fall back to a single shared fallback slot (or FL_ASSERT + fallback) rather than dereferencing null; free the allocated storage when setspecific fails.
Keep the fast path unchanged; add a unit test if failure can be injected cheaply (otherwise document why not).
Activity
chore(bloat): record +8 B esp32s3 image for ThreadLocal failure fallb…
fix(stl): ThreadLocalReal falls back to a shared slot when pthread ke…