I have been trying to automate some profiling (with gprof) by running some apps in Xvfb and record/replay with Xnee. Problem is, Xvfb crashes. In order to spot the bug I set up a less complex enviroment
Here’s the set up:
Terminal 1: Xvfb -ac :22
Terminal 2: export DISPLAY=:22 ; while (true) ; do xterm -e sleep 2 ; done
After executing some five or six programs Xvfb crashed. After some purely non scientific investigations it turns out that
- the bug happens less often when I run Xvfb through gdb (see below)
- Xvfb goes down with a seg fault in FreeColormap
Hmmm, colormap….. How about if we lower the colors in Xvfb? Yes, that’s it. Now, let’s move forward. To stress Xvfb a bit more, I have a new setup to test before I go on with Xnee’s automated profile (and coverage of course) tests:
Terminal 1: Xvfb -ac -screen 0 640x480x16 :21
Terminal 2: export DISPLAY=:22 ; while (true) ; do xterm -e sleep 2 ; done
Terminal 2: export DISPLAY=:22 ; while (true) ; do xdpyinfo ; xwininfo -root ; xset r on; done
…. after 1743 program executions I feel I am beginning to see a good enough work around.
And for those interested in the gdb printout, enjoy:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7c2fa10 (LWP 18983)]
0x08156e2b in FreeColormap ()