Author Archive

Ademar complained about certain programs such as Neverball and Metisse causing a crash in the X.org GLX code in systems with some Intel and ATI cards, specifically in a call to quadfunc_unfilled_rgba() when glPopMatrix() flushes vertices. After a quick inspection it was clear that the cause was a null pointer dereference in Mesa 7.0.1, so If you’re experiencing a similar problem you may want to try this trivial workaround:

Further information and possibly a better fix available at the original bug report.

Today at lunch boto handled me a QNX Neutrino 6.3.2 CD he was using in virtualization tests for Red Hat. I quickly installed it on a spare machine to see how well xmp would build on it — and it built quite well. After fixing some trivial build problems I examined the new sound system used in QNX6 (since the old drivers for QNX4 didn’t compile), and I was pleased to find that it’s based on the old ALSA 0.5 API. Xmp has an ALSA 0.5 driver written in 2000 by Tijs van Bakel and Rob Adamson, and it worked out of the box in Neutrino 6. Source patch and binary are available in the SF download page.

xmp in QNX Neutrino

Next targets to test/port xmp include Plan9 (new port), BeOS and AIX (drivers exist, but never tested), and OS/2, IRIX, HP-UX and Solaris (used to work, but not tested for a long time). Contact me if you have access to one or more of those (or other) systems and have some free time to test the portability of an old mod player.

Less than two months ago xmp was dug out of its grave, and today I’m pleased to announce the availability of version 2.2.0 — the first stable release in more than six years (RPM packages for Mandriva 2008.0 are already available). This version fixes a truckload of bugs and adds support for many module formats, including some from Atari ST/Falcon, Acorn Archimedes and Apple IIgs. Other highlights are the MacOS X driver and the Audacious plugin.

There’s a lot of ugly things in the code that are still to be fixed, but this version is certainly much, much better than the previous stable. Let’s hope the next version doesn’t take nearly as much time to be released as did this one.

Update: Ok, so we have a patch already. This is needed to build the package in non-Linux systems, especially OSX.

Update 2: You may want to get xmp 2.2.1 instead.

anarkey2.png Gustavo Boiko gave it a name so I threw in a couple of additional code lines to justify the name change. Unlike your previously unnamed hack, which generated only simultaneous key combinations, Anarkey handles sequential keystrokes as well. The configuration file format handles key “chords” like lilypond, so with Anarkey you can use

abc <64 102> 38 56 54

in the configuration file to generate a sequence of fake keystrokes ALT+Right, A, B and C when you run ./ak abc. Build with gcc -o ak ak.c -lXtst, ak.c is listed below. The code is released to the public domain, please refer to the original hack for additional details.

(more…)

Or a case study on how the knowledge of the basics of the Ancient Art of Assembly Programming can still save the day. Remember the last time you had to binary patch a program in Linux? Neither did I. But when we came across a binary-only executable doing very stupid things, with no source code in sight, no viable replacement at hand and no time or patience to code our own, binary patching didn’t sound too bad.

(more…)

Suppose that, for some reason, you’d like to have a program that sends a key combination such as <Control+Left Arrow> to your X server. You can do that trivially using the X Test extension and XTestFakeKeyEvent, but if you want something a bit more flexible you can add a configuration file like

fwd     64 102
back    64 100

where the command back would simulate simultaneous keypresses of ALT (keycode 64) and Left Arrow (keycode 100). Don’t ask why would someone want to do something like this — the only thing I can assure you is that we had a good reason. If that’s your case, the following C program is what you need. Released to the public domain, compile and link against libXtst.

Update: a better version is available.

(more…)

Bizarre bug of the day: I just can’t post the following snippet of code in Wordpress 2.2.1 running in Dreamhost:

        if ((f = fopen(CONFFILE, "r")) == NULL)
                fprintf(stderr, "can't find configuration file\\n"), exit(1);

If I try, the server happily replies with a nice 503 error:

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

If I replace fopen with “open” or “&#102;open” (like I did in the instance above) it works fine. Now can someone please explain me what’s going on?

Update: Ok, so Eduardo explained it. It’s mod_security doing something it shouldn’t, and the error message is totally misleading. Case closed (that was fast!).

Recent rediscovery of xmp and the amount of improvements on the player since then is proof that modplaying is still one of my obsessions favorite idle-time activities. Like coding, or reverse engineering file formats. Put them together, and what you get is a modplayer with support to strange file formats you possibly never heard of, such as STMIK (a precursor of Future Crew’s famous S3M format), MASI (used in some old DOS games such as Epic Pinball and Jazz Jackrabbit), DIGI Booster (Amiga), TCB Tracker (Atari) and so on. This time we had a different and intriguing challenge: a simple module format with a rather strange sound sample encoding. If you’re interested in retrocomputing, reverse engineering, investigative stories, or Python, read on.

(more…)

After some fun with “live” mod playing, Ademar asking me about mod playing and Paul Wise offering to maintain the project, I decided to do some work on the old xmp codebase and put it back into service. Recent changes include 64bit-safe code, an OSX driver, many Digitrakker MDL fixes and support for Atari ST/Falcon module formats. The changes were not announced, and it’s nice to see that someone already noticed!

My feeling is to rediscover an old toy long forgotten, and I’m very impressed with the fact that during the last week I could easily implement or fix things that were too hard or too boring to do many years ago. Also the code looks much uglier now. Do you have old Protracker mod files (or other obscure module formats) lying around? Give xmp a try and see if it builds/works correctly for you :)

As a software maintainer, sometimes you receive very peculiar bug reports ranging from laughable to completely bizarre, yet reproducible. Some of them are so strange they deserve a bit of post-mortem pondering and reflection, like this one. But first, it’s important to remember that the user reports what he sees, a manifestation of the bug — and that can be very different from the real causes of the problem. Ready to go? The next paragraph shows the original bug report, and then you’ll see what the investigations led us into.

Linux fails with a kernel panic on systems with a Celeron processor and 256MB of RAM when an Ext3 filesystem is created on a large partition and you set the number of blocks reserved to the superuser to 0 (mke2fs -j -m0). The problem doesn’t happen if you use a different processor, or in systems with 1GB of RAM.

(more…)