Yenya's World

Tue, 29 Apr 2008

GCC Tail-call Bug

Today I spent several hours debugging one of my distributed applications. The bug appeared to be in the sorting routine, which sometimes left the data not completely sorted. The strange thing was that when I added a debugging test at the end of each quick-sort recursive call (thus making sure I catch the unsorted data as early as possible), the problem has disappeared.

So, another Heisenbergish bug, I think. The source code is here: it is a straightforward recursive quick-sort, sorting entries with 32-bit key and 32-bit value (written to work on 64-bit systems only, do not bother to report that it is broken on legacy systems).

Now try to compile it and run with gcc -O2. For me (gcc 4.1.2 from Fedora 8) it works. However, when using -O3 (or even -O2 -finline-functions) it doesn't. Also when you uncomment the debug printout at the end of qsort_data(), it should work even with -O3. I think the tail-call recursion is not enabled when the debugging code is present.

Does it work for you? Is my code broken in a way I don't see? If this is not only a problem of my system, I will try to report it as a gcc bug.

Section: /computers (RSS feed) | Permanent link | 5 writebacks

Mon, 28 Apr 2008

OpenSolaris, try 1

Given the recent uproar between the OpenSolaris community and Sun corporate overlords (insightfully commented by Ted Ts'o), I have decided to give OpenSolaris a try.

It was a failure: I did not found what version should I download:

So, my dear lazyweb, where would you start if you wanted to try OpenSolaris without registering, and with access to all the source in the Open Source(tm) manner, including the rights to modify the software and publish benchmarks? And, more importantly, have you ever kissed a girl?

Section: /computers (RSS feed) | Permanent link | 5 writebacks

Fri, 11 Apr 2008

Gentoo Linux - the next try

Since I have got a new workstation which supports hardware virtualization, I have installed several different operating systems to my virtual machines. I have already tried Gentoo Linux, so I gave it another try. Again, it was a bit frustrating - few examples:

I think Gentoo can be excellent for newbie geeks who want to discover what this Linux thing is about, but even that has its limitations. For example, when I upgrade Fedora on my workstation, often many packages which I would normally refuse to install as a superfluous garbage get installed by the distribution. Which is good, because I have an opportunity to look at them later, in already working preconfigured state (in the past it included D-Bus, HAL, SELinux, and many others).

I also cannot imagine how would I maintain tens of differently configured machines running Gentoo. Having fixed release points with security upgrades designed and tested on them is a big bonus, as are the precompiled packages with automatic dependencies. yum update and you are done with minimal risk of breaking something.

Section: /computers (RSS feed) | Permanent link | 11 writebacks

Fri, 04 Apr 2008

Fedora Bugzilla

Half a year ago, I have ranted about Fedora maintainers ignoring my bug-report #240070 for several months, and then just asking to verify that the problem still exists in the current version, without any attempt to reproduce the bug (do not even think about attempting to solve it). Well, here is the summary of the development since then (you can also read the comments to this bug yourself):

The bug has been originally filled against Fedora Core 6. Since then, I have reproduced it on Fedora 7, and also Fedora maintainer Matěj Cepl has verified it on his workstation. He subsequently changed the "distribution" attribute to "devel", so that the bug did not get lost when FC6 reached its end of life. Well, it did not help.

Without any other maintainer attempting to look at it, today I have got another automatic response:

Based on the date this bug was created, it appears to have been reported against rawhide during the development of a Fedora release that is no longer maintained [...]

If you can reproduce this bug in a maintained Fedora version (7, 8, or rawhide), please change this bug to the respective version and change the status to ASSIGNED.

Just to be cooperative, I have verified that the bug still exists in F7, F8 _and_ the current rawhide. Can anybody tell me how should I report Fedora bugs in so they do not get lost? The bug #201436 is another similar case - read its comments if you need a sad reading for the weekend ...

Section: /computers (RSS feed) | Permanent link | 0 writebacks

Thu, 03 Apr 2008

EXIF Comment

For an internal project, we need to store comments inside the JPEG images. I think the EXIF tag UserComment is suitable for our purpose (we need texts also in the Czech language, and the alternative tag, ImageDescription, is strictly US-ASCII only). Nevertheless, the problem still lies in the character set area.

The EXIF standard (PDF warning, look at 34th page, numbered "page 28" near the bottom) defines the UserComment data such that the first 8 bytes contain the charset info (strings "ASCII", "JIS", or "UNICODE" padded to 8 bytes with null bytes), and then the comment data. The problem is what "UNICODE" means. Is it UTF-8, UTF-16, or what?

I have tried to set the comment using Exiv2 utility, and tried to read it with Image::ExifTool Perl library. The following code prints the raw UserComment value (i.e. the string "UNICODE\0my_own_comment_as_utf8_bytes"):

#!/usr/bin/perl -w
use Image::ExifTool
my $info = Image::ExifTool::ImageInfo("exif_comment.jpg",
       { Charset=> "UTF8",PrintConv=>0 });
print $info->{UserComment}, "\n";

However, with PrintConv=>1 it prints garbage, so probably the UNICODE charset in EXIF means something different than UTF-8.

JPEG with EXIF comment

So, what does your favourite image handling program display as the EXIF UserComment for the above image? It should read: "Příliš žluťoučký kůň. こんにちは。".

Section: /computers (RSS feed) | Permanent link | 4 writebacks


Yenya's World: Linux and beyond - Yenya's blog.


RSS feed

Jan "Yenya" Kasprzak

The main page of this blog



Blog roll:

alphabetically :-)