Isolate a Buggy Commit with Git Bisect

25.03.2007 at 13:34

A few weeks a go I made a blog post about my success in running Age of Empires II with Wine. Unfortunately the upgrade from wine-0.9.31 to 0.9.32 broke it again. The game doesn't even start anymore and just displays the following message:

Could not initialize graphics system. Make sure your video card and driver are compatible with directdraw.

See the AppDB Comments for further discussions.

So I decided to try to isolate the commit which is responsible for the breakage. The first step was to get all the required build dependencies installed. Next I did a checkout of the wine source and started regression testing as explained on the wine-wiki. By telling git bisect the last good state and a known broken one it can perform a binary search for the buggy commit.

git bisect start
git bisect good wine-0.9.31
git bisect bad wine-0.9.32

Then you can compile Wine and test whether the bug is still there.

CFLAGS=-fno-stack-protector ./configure && make clean && make depend && make

Depending on the result you run git bisect good or git bisect bad respectively. If you want to see which commits could cause the error run git bisect visualize. Recompile and repeat the above steps until you can isolate the problematic commit. In my case it was the following:

27113156d96d20296409fcb92839609c8dd7e34a is first bad commit
commit 27113156d96d20296409fcb92839609c8dd7e34a
Author: Stefan Dosinger <>
Date:   Mon Feb 19 15:24:00 2007 +0100

    wined3d: Remove IWineD3DDevice::EnumDisplayModes.

So now that I have isolated the commit, I filled a bug report.


read more comments

Sql Fun: Order before Group with a Sub Query

19.02.2007 at 17:49

I have came across a problem within a SQL statement. Say we have 2 tables which are in a 1:n relationship. So we want to join them together normally the SQL engine will just use the first match based on the auto increment key within the table. This isn't what I needed so I searched a way to actually sort the data before the grouping happened. The solution seems to be a sub query which isn't ideal performance wise but worked for my use case. So I ended up with something like this:

    SELECT lastname, firstname, address_addition FROM address
    LEFT JOIN othertable ON address.somefield = othertable.somefield
    ORDER BY whatever
) as addresses GROUP BY addresses.address_id

Which brought me to the next problem, the SQL standard doesn't allow duplicate column names within a sub query and mysql does actually implement this part of the standard -- surprise ;)

So I had to "retag" a few fields in the selected clause with AS. Lesson learned: always use a short table prefix.


read more comments

UUIDs for Partitions in Ubuntu Edgy Eft 6.10

14.02.2007 at 17:04

I recently updated a Ubuntu Dapper Drake (6.06) system to Edgy Eft (6.10). Other than I had to reinstall/reconfigure my xserver everything went ok. However, by the next reboot I noticed a strange root=[long alphanumeric value] kernel parameter in my grub prompt. After some investigation I found out that my /etc/fstab contained the same strange ids.

# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/hdc5 -- converted during upgrade to edgy
UUID=048b4608-5241-4dc4-8671-f8290cb55af5 / ext3 defaults,errors=remount-ro 0 1
# /dev/hdc1 -- converted during upgrade to edgy
UUID=05c63290-f5b8-4afb-97c1-fb7e15ad6ed8 /boot ext2 defaults 0 2
# /dev/hdc10 -- converted during upgrade to edgy
UUID=06ee7e3e-768b-4a51-a31f-0e70ec314e81 /data ext3 defaults 0 2
# /dev/hdc7 -- converted during upgrade to edgy
UUID=56ef33df-9f30-4577-b1de-83b540fd3519 /home ext3 defaults 0 2
# /dev/hdc11 -- converted during upgrade to edgy
UUID=9628b57a-cd57-4ffb-a0e7-6d2bc349e46b /media/hdc11 ext3 defaults 0 2
# /dev/hdc12 -- converted during upgrade to edgy
UUID=caa74b76-416b-46aa-8c0a-f6348f6afbcd /media/hdc12 ext3 defaults 0 2
# /dev/hdc13 -- converted during upgrade to edgy
UUID=fe873ec7-3176-4aad-b0b1-9164f938f213 /media/hdc13 ext3 defaults 0 2
# /dev/hdd1 -- converted during upgrade to edgy
UUID=9E745EF6745ED11F /media/hdd1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/hdd5 -- converted during upgrade to edgy
UUID=78DB-0025 /media/hdd5 vfat defaults,utf8,umask=007,gid=46 0 1
# /dev/hdc9 -- converted during upgrade to edgy
UUID=b43c2193-3c00-48d0-8c29-c2fa7212c457 /usr ext3 defaults 0 2
# /dev/hdc8 -- converted during upgrade to edgy
UUID=7cec1fb3-c2f2-46dc-9782-7228d57b9f2b /var ext3 defaults 0 2
# /dev/hdc6 -- converted during upgrade to edgy
UUID=6996378e-a37b-49b8-8e91-65164bef7626 none swap sw 0 0
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

My first thought: what a mess! Luckily they left some comments in there.

So what is the purpose of those numbers which are not so human friendly? They should uniquely identify a given partition. Which means you could swap your disks, USB sticks, whatever and the system will still mount the correct partition at the right place. Another thing this mechanism tries to work around is, that the device names depend on module load order. With the development in recent kernels which try to scan the hardware and detect devices in parallel, to speed up boot time, it will be entirely random which devices turns up as /dev/sda.

Listing UUIDs

You may ask how can I check the mappings between UUIDs and devices? Good question -- there are a few different ways, /sbin/blkid will happily print a list of device names, filesystem labels and UUIDs for you even if you aren't root. While sudo vol_id -u <partion> will give you only the exact UUID for the requested partition.

After I have informed myself about those UUIDs I am no longer that scared but I still think this is a sub optimal solution they are just way too human unfriendly. A solution based on disk LABELS is probably the better approach.


read more comments

Playing Age of Empires 2 with Wine 0.9.30

14.02.2007 at 12:50

I am absolutely not a gamer, but today I was sick at home and wondered what I could do, so I decided to try whether I could run Age of Empires 2 + the Conquerors expansion with Wine.

According to the Wine APP DB [1,2] this should be possible -- and it was. Installation was straight forward and worked perfectly, just mount the cdrom and execute the setup with wine. Because wine doesn't yet support the required copy protection (safedisc2?) the game needs a no cd crack in order to run. This isn't a problem either since all required information can be found on the APP DB site. At first performance was really bad but then I disabled the sound (via winecfg) set the game resolution to 800x600 and reduced graphic detail. With this configuration the game was playable on my P4 2.8 GHz, however a DIB engine wouldn't hurt either ;)

There is a strange thing which I noticed, if I start the game then switch back to the terminal, kill wineserver and restart the game it is quite a bit faster. Haven't yet investigated further in what's actually going on.

Thanks to all Wine developers for their work, you made my day :)


read more comments

QEMU 0.9.0 and KQEMU Released Under the GPL

06.02.2007 at 13:01

QEMU 0.9.0 brings lots of improvements and KQEMU is finally released under the GPL -- thanks Fabrice.

Other interesting things happen in the current KVM development with the recent work from Ingo Molnar on KVM paravirtualization for Linux which gives pretty impressive performance.

Unfortunately I currently don't have time to work on qemu-gui and there doesn't seem to be much interest anyway.

So long, Marc.

read more comments

<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 >>