_XIOError terminates app with exit(1) call

Dubravko Gorupic dubravko.gorupic at stotz.hr
Mon May 26 06:04:52 PDT 2014


We're developing some complexed application which consists of linux 
binary integrated with java jni calls (from JVM created in linux binary) 
from our custom made .jar file. All gui work is implemented and done by 
java part. Each time some gui property has to be changed or gui has to 
be repainted, it is done by jni call to JVM.
Complete display/gui is repainted (or refreshed) as fast as JVM/java can 
handle it. It is done iteratively and frequently, few hunderds or 
thousands iterations per second.

After some exact time, application is terminated with exit(1) which I 
caught with gdb to be called from _XIOError(). This termination can be 
repeated after more or less exact time period, e.g. after some 15h on 
x86 dual core 2.5GHz. If I use some slower computer, it lasts longer, 
like it is proportional to cpu/gpu speed. Some conclusion would be that 
some part of xorg ran out of some resource or something like that.

Here is my backtrace:
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7c50941 in raise () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#2  0xb7c53d72 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#3  0xb7fdc69d in exit () from /MSM/bin/liboverrides.so
#4  0xa0005c80 in _XIOError () from /usr/lib/i386-linux-gnu/libX11.so.6
#5  0xa0003afe in _XReply () from /usr/lib/i386-linux-gnu/libX11.so.6
#6  0x9fffee7b in XSync () from /usr/lib/i386-linux-gnu/libX11.so.6
#7  0xa01232b8 in X11SD_GetSharedImage () from 
/usr/lib/jvm/jre1.8.0_20/lib/i386/libawt_xawt.so
#8  0xa012529e in X11SD_GetRasInfo () from 
/usr/lib/jvm/jre1.8.0_20/lib/i386/libawt_xawt.so
#9  0xa01aac3d in Java_sun_java2d_loops_ScaledBlit_Scale () from 
/usr/lib/jvm/jre1.8.0_20/lib/i386/libawt.so

I made my own exit() call in liboverrides.so and used it with LD_PRELOAD 
to capture exit() call in gdb with help of abort()/SIGABRT.
After some debugging of libX11 and libxcb, I noticed that _XReply() got 
NULL reply (response from xcb_wait_for_reply()) that causes call to 
_XIOError() and exit(1). Going more deeply in libxcb in 
xcb_wait_for_reply() function, I noticed that one of the reasons it can 
return NULL reply is when it detects broken or closed socket connection, 
which could be my situation.
For test purposes, if I change xcb_io.c and ignore _XIOError(), 
application doesn't work any more. And if I repeat request inside 
_XReply(), it fails each time, i.e. gets NULL response on each 
xcb_wait_for_reply().

So, my questions would be why such uncontrolled app termination with 
exit(1) from _XReply() -> XIOError() -> exit(1) happened or how can I 
find out reason why and what happened, so I can fix it or do some 
workaround.

For this problem to repeat, as I wrote above, I have to wait for some 
15h, but currently I'm very short on time for debuging and can't find 
the cause of problem/termination.
We also tried to reorganise java part which handles gui/display refresh, 
but the problem wasn't solved.

Some SW facts:
- java 8 or 7, last versions
- libX11.so 1.5.0
- libxcb.so 1.8.1
- debian wheezy
- kernel 3.2.0

Tnx.
Bye, dudo.


More information about the xorg mailing list