GNU Xnee: Workaround for Xvfb bug

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

  1. the bug happens less often when I run Xvfb through gdb (see below)
  2. 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 ()

Comments on quality and comparing Free Software with proprietary

In an aricle (Swedish only!) in a swedish computer mag a lawyer (refered to as an expert) says that proprietary programs are better in quality than free ones.

Let’s analyse the article a bit.

– Det krĂ€vs en morot för att man ska anstrĂ€nga sig ordentligt. Om den stora inkomstkĂ€llan stĂ„r och faller med kvaliteten pĂ„ koden tror jag att man anstrĂ€nger sig mer, sĂ€ger hon.

In English the important thing would be something like.

… If the main income is depending on the quality of the code I think one strains more.

Is money the only incentive? A happy customer sure is an incentive for me. Well, well, let’s pretend it is. OK, what does this have to do with the type of license? She explains:

Öppna program brukar nĂ€mligen ofta vara gratis och de företag som utvecklar sĂ„dana satsar i stĂ€llet pĂ„ att dra in pengar pĂ„ kringtjĂ€nster som support, utbildning och anpassning. Det leder bort fokus frĂ„n sjĂ€lva mjukvaran.

Which would translate into (stripped down):

.. foss companies usually get their money from support, education and adaptions. This leads focus away from the software itself.

First of all, I would say that most companies make money from support, education and adaptions. Regardless of the license of their product. But let’s look at her argument for a while. Why would this lead away focus? There’s no answer to that.If I have a crappy product out there (under GPL and publically available) will notice some one will notice and they will either fix the crappy code and patch the product or they will provide an updated and forked product. If the product was proprietary no one would have known about the crappy code. If that’s her argument, that no customer will notice about the crappy code, she’s right in advising people to close their products. But looking at it from an end user point of view, I sure like to see the source code and have the four freedoms. But she speaks about code quality. No, I don’t understand from what she draws her conclusion.

…. well well well, time to go to work.

But before I leave I must say it’s kind of funny that the journalist points out that the second person in the article is working for an “Open Source” company. A bit like saying he is biased. In the article it doesn’t say that the lawyer used to work for Microsoft or that she’s also a member of Svenska föreningen för upphovsrĂ€tt (SFU) as is MIcrosoft.

btw, she never says hoe she measures code quality, but I guess she is backed up by a research 😉 Perhaps by one of them Swiss reasearch institutes that research in shampoos.

New GNU releases Ocotber 2008

This is a compilation of the GNU software releases as
announced during October 2008 on the mailing list:

glpk 4.33 / 2008-10-30
GLPK (GNU Linear Programming Kit) is intended
for solving large-scale linear programming (LP),
mixed integer linear programming (MIP), and
other related problems.

Libidn 1.11 / 2008-10-29
Libidn is a fully documented implementation of the Stringprep,
Punycode and IDNA specifications defined by the IETF
Internationalized Domain Names (IDN) working group, used for
internationalized domain names.

Binutils 2.19 / 2008-10-29
The GNU Binutils are a collection of binary tools.
The main ones are: ar, ld

GNU Gama 1.9.06/ 2008-10-29
GNU Gama is a project dedicated to adjustment of
geodetic networks.

GNU CLISP 2.47 / 2008-10-24
ANSI Common Lisp is a high-level, general-purpose
programming language.

GNU SASL 0.2.29 / 2008-10-22
GNU SASL is a modern C library that implement the
standard network security protocol Simple
Authentication and Security Layer (SASL).

bzr 1.8 / 2008-10-17
Bazaar is a distributed version control system that Just Works.

Gnash 0.8.4 / 2008-10-14
Gnash is a GPL’d Flash movie player and browser
plugin for Firefox, Mozilla, Konqueror, and Opera.

GNU ed 1.1 / 2008-10-14
GNU ed is an 8-bit clean, more or less POSIX-compliant
implementation of the standard Unix line editor.

Gnash 0.8.4 / 2008-10-13
Gnash is a GPL’d Flash movie player and browser
plugin for Firefox, Mozilla, Konqueror, and Opera.

GNU swbis 1.0 / 2008-10-13
swbis is a software administration system for GNU/Linux systems and
systems that are UNIX system-like

GNU M4 1.4.12 / 2008-10-11
GNU M4 is an implementation of the traditional
Unix macro processor.

pspp-0.6.1 / 2008-10-10
PSPP is a program for statistical analysis
of sampled data.

GnuTLS 2.6.0 / 2008-10-06
GnuTLS is a modern C library that implement the standard
network security protocol Transport Layer Security (TLS),
for use by network applications.

coreutils-7.0 / 2008-10-06
The GNU Core Utilities are the basic file, shell and text
manipulation utilities of the GNU operating system. These
are the core utilities which are expected to exist on every
operating system.

glpk 4.32 / 2008-10-03
GLPK (GNU Linear Programming Kit) is intended
for solving large-scale linear programming (LP),
mixed integer linear programming (MIP), and
other related problems.

GNU Ball and Paddle 0.8.0/ 2008-10-01
Ball and Paddle is a ball and paddle game with
blocks, a ball, a paddle, and some powerups.

If you have any comments or questions regarding this
compilation, contact Henrik Sandklef

GNU Xnee, Xvfb and Xephyr …. and evdev?

In an attempt to automate (read cron) the Xnee tests using swinput I did the following:

  • Start Xvfb (Xvfb can’t read any keyboard and mouse)
  • Start Xephyr inside Xvfb (using evdev as input)
  • Attach the swinput devices to the Xephyr display only

Still the faked user input (mouse, keyboard) from swinput was ‘written’ to the console. Uh oh. Bad!

So, I will now with a new computer (with more than the 500MB of RAM I have on this) test Xnee in a sandbox, probably using qemu for both x86 and ppc. Doing this I should be able to:

  • Run every test case and report using the new coverage stuff in gnulib. All tests and builds can be done in x86 as well as ppc.
  • Verify that cross compilation to ppc works

Can’t wait….. but I have to.

GNU Xnee auto coverage is almost there … but

No, don’t check in CVS. Everything is not there yet. Why did I post then? … b’cuz I wanted to.

Anyhow. The gnulib is now integrated in GNU Xnee‘s autotools Makefiles. Well, part of gnulib to be more precise. I wrote a small script that does everything needed (this is missing in CVS at the moment).

When having produced the coverage reports (currently here) I realise that about 80% of the test will not be possible to automate.

Since GNU Xnee itself is a tool to record and fake user actions under X11 it would be sub optimal to use a similar tool (using RECORD and XTest extensions). Instead GNU Xnee relies in swinput for testnig. Swinput is a small kernel (linux) module that opens up two devices (/dev/swmouse and /dev/swkeybd) and using these you can fake user input from kernel. When testing replaying we use a small program (GNU Xnee sources) called xgetter which can read the mouse pos and some other stuff. ….. get on with it. Ok, sorry!

It’s impossible to test GNU Xnee using swinput under Xvfb since the faked keyboard strokes and mouse actions will be ‘written’ to the console or some sort of DM (GDM, XDM, KDM,….).

Too bad …. need to think some more.

GNU Xnee and automated code coverage

Have been looking in to some work done by Simon Josefsson. GNU Xnee can now do automated code coverage. Will integrate a bit better before I put it up on the new build machines I am setting up (one GNU x86 & one GNU PPC). GNU Xnee will report something like:

I need to make sure that the test scripts work with Xvfb. I’ve only been executing them in a ‘normal’ X server. But since the building of Xnee documentation works fine in Xvfb it should be ok. And for those interested, Xnee builds eps, ps, pdf, jpg images from dia graphics using dia who needs an X server. And yes Xnee uses some other tools as well for that.

Nice way to spend your Saturday night, isn’t it 🙂