I have a GTK application which occasionally crashes with an "interrupted system call" g_message from gdk. After a lot of debugging, I've found that the call to recvmsg in _xcb_in_read occasionally fails with EINTR, and instead of retrying the system call, xcb would just shut down the connection. This change makes _xcb_in_read treat EINTR the same as it would treat EAGAIN; it returns 1 and libX11 ends up calling xcb_poll_for_event again (from what I have understood). I have spoken with a few people who think recvmsg failing with EINTR in this case shouldn't ever happen, and I don't know enough to agree or disagree with that. In case anyone wants to dig further and try to figure out why the recvmsg call sometimes fails with EINTR, here's the backtrace from inside of _xcb_in_read where that happened: Thread 1 "beanbar" hit Breakpoint 1, _xcb_in_read (c=c@entry=0x55ecbe4aba80) at xcb_in.c:1059 1059 fprintf(stderr, "Hello World am %s:%i, errno is %s\n", __FILE__, __LINE__, strerror(errno)); (gdb) bt 0 0x00007fa48fa48639 in _xcb_in_read (c=c@entry=0x55ecbe4aba80) at xcb_in.c:1059 1 0x00007fa48fa489d8 in poll_for_next_event (c=0x55ecbe4aba80, queued=queued@entry=0) at xcb_in.c:352 2 0x00007fa48fa48a3d in poll_for_next_event (queued=0, c=<optimized out>) at xcb_in.c:722 3 0x00007fa48fa48a3d in xcb_poll_for_event (c=<optimized out>) at xcb_in.c:722 4 0x00007fa4908d1b7e in poll_for_event (dpy=dpy@entry=0x55ecbe4a9730, queued_only=queued_only@entry=0) at xcb_io.c:245 5 0x00007fa4908d1cf0 in poll_for_response (dpy=dpy@entry=0x55ecbe4a9730) at xcb_io.c:303 6 0x00007fa4908d1fed in _XEventsQueued (mode=2, dpy=0x55ecbe4a9730) at xcb_io.c:363 7 0x00007fa4908d1fed in _XEventsQueued (dpy=dpy@entry=0x55ecbe4a9730, mode=mode@entry=2) at xcb_io.c:344 8 0x00007fa4908c3d47 in XPending (dpy=0x55ecbe4a9730) at Pending.c:55 9 0x00007fa493cadbc7 in () at /usr/lib/libgdk-3.so.0 10 0x00007fa49234d08a in g_main_context_prepare () at /usr/lib/libglib-2.0.so.0 11 0x00007fa49234d6e6 in () at /usr/lib/libglib-2.0.so.0 12 0x00007fa49234d8ae in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0 13 0x00007fa4938b920e in g_application_run () at /usr/lib/libgio-2.0.so.0 14 0x000055ecbc820af4 in main (argc=1, argv=0x7ffd06238098) at src/main.c:190 Signed-off-by: Martin Dørum <martid0311@gmail.com> |
||
---|---|---|
doc | ||
m4 | ||
man | ||
src | ||
tests | ||
tools | ||
.autom4te.cfg | ||
.gitignore | ||
COPYING | ||
Makefile.am | ||
NEWS | ||
README.md | ||
autogen.sh | ||
check-pc-requires | ||
configure.ac | ||
xcb-composite.pc.in | ||
xcb-damage.pc.in | ||
xcb-dpms.pc.in | ||
xcb-dri2.pc.in | ||
xcb-dri3.pc.in | ||
xcb-ge.pc.in | ||
xcb-glx.pc.in | ||
xcb-present.pc.in | ||
xcb-randr.pc.in | ||
xcb-record.pc.in | ||
xcb-render.pc.in | ||
xcb-res.pc.in | ||
xcb-screensaver.pc.in | ||
xcb-shape.pc.in | ||
xcb-shm.pc.in | ||
xcb-sync.pc.in | ||
xcb-xevie.pc.in | ||
xcb-xf86dri.pc.in | ||
xcb-xfixes.pc.in | ||
xcb-xinerama.pc.in | ||
xcb-xinput.pc.in | ||
xcb-xkb.pc.in | ||
xcb-xprint.pc.in | ||
xcb-xselinux.pc.in | ||
xcb-xtest.pc.in | ||
xcb-xv.pc.in | ||
xcb-xvmc.pc.in | ||
xcb.pc.in |
About libxcb
libxcb provides an interface to the X Window System protocol, which replaces the traditional Xlib interface. It has several advantages over Xlib, including:
- size: small, simple library, and lower memory footprint
- latency hiding: batch several requests and wait for the replies later
- direct protocol access: interface and protocol correspond exactly
- proven thread support: transparently access XCB from multiple threads
- easy extension implementation: interfaces auto-generated from XML-XCB
Xlib also uses XCB as a transport layer, allowing software to make requests and receive responses with both, which eases porting to XCB. However, client programs, libraries, and toolkits will gain the most benefit from a native XCB port.
More information about xcb is available from our website:
Please report any issues you find to the freedesktop.org bug tracker at:
https://gitlab.freedesktop.org/xorg/lib/libxcb/issues
Discussion about XCB occurs on the XCB mailing list:
https://lists.freedesktop.org/mailman/listinfo/xcb
You can obtain the latest development versions of XCB using GIT from the libxcb code repository at:
https://gitlab.freedesktop.org/xorg/lib/libxcb
For anonymous checkouts, use:
git clone https://gitlab.freedesktop.org/xorg/lib/libxcb.git
For developers, use:
git clone git@gitlab.freedesktop.org:xorg/lib/libxcb.git