Xvfb with Composite crashes

Irek Szczesniak ijs at txcorp.com
Fri Apr 29 11:48:24 PDT 2005


Hi,

I am running Xvfb, X.org v. 6.8.2, with the Composite extension
enabled on Fedora Core 3, Linux 2.6.10.  I am running Xvfb this way:

> Xvfb :102 +extension Composite -ac

Then I run:

> export DISPLAY=:102
> xterm
> kill $!

When xterm quits, Xvfb crashes with Segmentation fault.  This is the
output of gdb:

> Program received signal SIGSEGV, Segmentation fault.
> 0x080595f9 in FreeColormap ()
> (gdb)

Running strace this way:

> strace Xvfb :102 +extension Composite -ac

returns no interesting information:

> select(256, [0 1 3], NULL, NULL, {596, 687000}) = 1 (in [3], left 
> {595, 980000})
> setitimer(ITIMER_REAL, {it_interval={0, 20000}, it_value={0, 20000}}, 
> NULL) = 0
> gettimeofday({1114791710, 562425}, NULL) = 0
> read(3, "", 4096)                       = 0
> shutdown(3, 2 /* send and receive */)   = 0
> close(3)                                = 0
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++

Xvfb doesn't crash if the Composite extension is not enabled.

However, there is a workaround for this problem.  The following
program works as an envelope for other programs that want to use Xvfb
with the Composite extension, but without crashing Xvfb.

> #include <X11/Xlib.h>
> #include <stdlib.h>
> #include <stdio.h>
>
> int main(void)
> {
>  XEvent ev;
>  Display *dpy;
>
>  if (dpy = XOpenDisplay (0))
>    XNextEvent (dpy, &ev); /* kills the program when Xvfb quits */
>  else
>    fprintf(stderr, "Cannot open display %s\n", getenv("DISPLAY"));
>
>  return 0;
> }

Having this envelope we first run Xvfb with the Composite extension,
then this envelope, and finally we can run any number of times other X
applications.  At the very end we kill Xvfb, and the envelope quits 
automatically.

QUESTION: is there a simpler fix for this bug?  If not, it my
envelope an acceptable workaround or should I expect more problems?

Thanks for reading!


Best,
Irek



More information about the xorg mailing list