[PATCH] Flush buffer in time for global (un)lock xserver operation
Chen Gang
chengang at emindsoft.com.cn
Fri Dec 13 05:54:32 UTC 2019
On 2019/12/12 下午7:01, walter harms wrote:
>
> short version,
> can you provide an example works.c vs. not_works.c ?
>
> re,
> wh
>
Excuse me, I did not write any example .c files. Originally, I directly
fixed the gui quiting issue by adding _XFlush() after GetEmptyReq() for
XUngrabServer in libX11.
The issue details are:
- Caja unlocks the xorg, but does not send the unlock event in its que.
- Caja then prepares quiting, and wait event for XSession.
- Now, XSesssion is waiting xorg for some gui related communication.
- But Xorg is locked by Caja, and can't get any messages from XSession.
- So the whole gui is dead.
For analyzing:
- We can gdb xorg, p *(clients[GrabInProgress]->clientIds), we know it
is locked by caja (clients and GrabInProgress are all global objects, so
we can get the value in release version with individual debug symbols).
- We can gdb xsession (in my case, it is emind-session which is based
on mate-session), and print its stack to know it is waiting for xorg.
gdb caja and print its stack to know that it is waiting for xsession.
- Modify libX11 to save the display object pointer, and gdb caja again.
Print the display object's buffer and bufptr, then check the contents
between buffer and bufptr to know the unlock event is in its buffer.
More information about the xorg-devel
mailing list