Closed
Description
Bug Report
There seems to be a race condition in libco:
fluent-bit/lib/flb_libco/amd64.c
Lines 132 to 135 in 5647069
Here
co_swap
is a static function pointer, which is assigned to a bunch of data in co_swap_function
that corresponds to assembly instructions before first use.
However this code assume that pointer assignment is regular, which is likely platform dependent. Better to use pthread_once
rather than checking if its null
.
This code should probably be using inline assembly macros instead of writing data to an unsigned char
and interpreting it as a function, then they wouldn't have to worry about initializing things before first use in the first place.