GLXOSD is an extensible on-screen display (OSD)/overlay for OpenGL applications running on Linux with X11 which aims to provide similar functionality to MSI Afterburner/RivaTuner OSD. It can show FPS, frame timings, temperatures and more in OpenGL games and applications. It can also be used to benchmark games, much like voglperf.
This is a theoretical issue that I haven't seen in practice, but still worth fixing?
In particular, this code:
void GLXOSD::osdHandleBufferSwap(Display* display, GLXDrawable drawable) {
...
if (osdVisible && display && drawable) {
auto it = drawableHandlers->find(glXGetCurrentContext());
OSDInstance* instance;
if (it == drawableHandlers->end()) {
instance = new OSDInstance();
drawableHandlers->insert(
std::pair(
glXGetCurrentContext(), instance));
} else {
instance = (*it).second;
glXSwapBuffers can be called from multiple threads at the same time, if they are using independent contexts. The use of drawableHandlers map isn't thread safe, inserting an element there while another thread is iterating (find) on the map will likely crash.
This is a theoretical issue that I haven't seen in practice, but still worth fixing?
In particular, this code:
glXSwapBuffers can be called from multiple threads at the same time, if they are using independent contexts. The use of drawableHandlers map isn't thread safe, inserting an element there while another thread is iterating (find) on the map will likely crash.