nickguletskii / GLXOSD

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.
https://glxosd.nickguletskii.com
MIT License
123 stars 20 forks source link

Deadlock in XKeysymToKeycode #35

Closed ghost closed 8 years ago

ghost commented 8 years ago

When I mashed the Shift+F9 key during a loading screen in Metro 2033: Redux, the game froze. gdb shows a deadlock with glxosd in the callstack.

First time this happened to me. I will update this ticket if it happens again.

GLXOSD commit b786796dd8feb251b2

(gdb) bt
#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f285f6fb657 in _L_lock_909 () from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007f285f6fb480 in __GI___pthread_mutex_lock (mutex=0x28dc470) at ../nptl/pthread_mutex_lock.c:79
#3  0x00007f285ed86c33 in ?? () from /home/scrawl/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libX11.so.6
#4  0x00007f285ede55e1 in _XkbReloadDpy () from /home/scrawl/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007f285ede5f84 in XKeysymToKeycode () from /home/scrawl/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libX11.so.6
#6  0x00007f2860c3628b in glxosd::keyComboMatches(glxosd::KeyCombo, XKeyEvent*) () from /usr/local//lib/x86_64-linux-gnu//glxosd/libglxosd.so
#7  0x00007f2860bcdbdb in glxosd::GLXOSD::osdEventFilter(_XDisplay*, _XEvent*, char*) () from /usr/local//lib/x86_64-linux-gnu//glxosd/libglxosd.so
#8  0x00007f2860bce4e9 in glxosd::osdEventFilter(_XDisplay*, _XEvent*, char*) () from /usr/local//lib/x86_64-linux-gnu//glxosd/libglxosd.so
#9  0x00007f285ed749e9 in XCheckIfEvent () from /home/scrawl/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libX11.so.6
#10 0x00007f2860ebfbe6 in XCheckIfEvent () from /usr/local//lib/x86_64-linux-gnu//glxosd/libglxosd-glinject.so
#11 0x00007f2861307e5a in XCheckIfEvent () from /home/scrawl/Steam/ubuntu12_64/gameoverlayrenderer.so
#12 0x00007f2860ecc1ca in handle_buffer_swap(_XDisplay*, unsigned long) () from /usr/local//lib/x86_64-linux-gnu//glxosd/libglxosd-glinject.so
#13 0x00007f2860ecc48a in glXSwapBuffers () from /usr/local//lib/x86_64-linux-gnu//glxosd/libglxosd-glinject.so
#14 0x00007f28612fd0a1 in glXSwapBuffers () from /home/scrawl/Steam/ubuntu12_64/gameoverlayrenderer.so
#15 0x0000000000dcabca in cb_replay(unsigned int*) ()
#16 0x0000000000db077a in backend_layer::kickoff(bool) ()
#17 0x0000000000dd48e1 in crender::render_loader() ()
#18 0x0000000000dd5043 in crender::render_internal(urender::server::presentation_mode) ()
#19 0x0000000000dd4f8d in crender::render(urender::server::presentation_mode) ()
#20 0x0000000000569ca7 in cengine::loader_render_while_loading() ()
#21 0x000000000056a40c in cengine::loader_execute(char const*, int, int) ()
nickguletskii commented 8 years ago

Thanks for reporting this bug. Definitely a mistake on my end, I will try to fix it tomorrow.

Your predicate procedure must decide if the event is useful without calling any Xlib functions. http://tronche.com/gui/x/xlib/event-handling/manipulating-event-queue/selecting-using-predicate.html

ghost commented 8 years ago

Seems to have been fixed in 588646148829935a6101016fb21ee573bbe9fe2d, so we can close this ticket I presume.