Bug Report
Describe the bug
fluent-bit segfaults at startup musl targets.
Under GCC 14 the upstream C-TLS probe no longer compiles (undeclared __tls_get_addr), so the pthread_key fallback calls pthread_getspecific() before pthread_key_create() and derefs a NULL tsd array on musl (glibc is unaffected).
A workaround for this is to force -DFLB_HAVE_C_TLS:BOOL=On for __thread TLS.
Another fix may be to make sure pthread_key_create() is called before pthread_getspecific()
Related:
openwrt/packages#29914
To Reproduce
- Compile fluent-bit with musl libc
- Start it and watch it crash
Expected behavior
No crash.
Screenshots
Your Environment
OpenWrt, which prefers musl libc.
Additional context
Bug Report
Describe the bug
fluent-bit segfaults at startup musl targets.
Under GCC 14 the upstream C-TLS probe no longer compiles (undeclared
__tls_get_addr), so thepthread_keyfallback callspthread_getspecific()beforepthread_key_create()and derefs a NULL tsd array on musl (glibc is unaffected).A workaround for this is to force -DFLB_HAVE_C_TLS:BOOL=On for __thread TLS.
Another fix may be to make sure
pthread_key_create()is called beforepthread_getspecific()Related:
openwrt/packages#29914
To Reproduce
Expected behavior
No crash.
Screenshots
Your Environment
OpenWrt, which prefers musl libc.
Additional context