It's useful to have a working X server if a client holds a grab when it triggers a debugger breakpoint
Owen Taylor
otaylor at redhat.com
Mon May 25 17:53:09 PDT 2009
On Tue, 2009-05-26 at 10:00 +1000, David Campbell wrote:
> Hi,
>
> Many/most GUI toolkits implement pop up menus using grabs. This can
> cause major desktop lockups when debugging GUI applications, because
> hitting breakpoints in pop up menu callback code will occur while a grab
> is active.
>
> Reaching a breakpoint while a grab is active indefinitely locks up the X
> server, leaving a standalone desktop user the only option but to power
> down and suffer potential data loss.
Or kill the debugging process by switching to a VT or remotely.
> Up until recently, the AllowDeactivateGrabs functionality could be
> configured such that the grabs could be deactivated with certain
> keystrokes, but this functionality has now been removed from the X
> server in the following change
> http://cgit.freedesktop.org/xorg/xserver/commit/?id=5e43cd28692bc05cac80f38b47104a26c0524385
>
> Given the absence of the above functionality, where grabs are used by
> underlying GUI libraries, it is impossible to debug popup menu callback
> code where the debugger and the application are running in the same X
> server due to grab lockout. This appears to be a critical issue.
>
> I draw your attention to consideration of this matter....is there a way
> that the X server could be enhanced to recognise processes that have
> been suspended and automatically cancel their grabs and avoid this
> problem? Should the AllowDeactivateGrabs functionality be restored in
> the interim while a full solution is thought through?
Qt has traditionally detected that it is running under gdb and turned
off grabs automatically. (I haven't tried it recently, I assume it still
does this.)
GTK+ supports 'export GDK_DEBUG=nograbs'. GTK+ also ungrabs and does an
XFlush() before running menu item callbacks.
You can debug remotely.
I wouldn't disagree that there is a problem for novice programmers,
debugging a GUI app for the first time. But for these people, an obscure
way to reconfigure their X server doesn't help much either.
- Owen
More information about the xorg
mailing list