about me





Sam Hocevar’s .plan

This is an experimental blog engine. RSS feeds: everything | blog | Debian (DPL only) | VideoLAN | GNOME | Mono

Attention everyone

Posted on Thu, 1 Apr 2010 11:13:09 +0200 - Keywords: debian, devel, videolan

Today, the Internet will be full of bullshit.

Coder wanted at DONTNOD Entertainment

Posted on Fri, 28 Aug 2009 10:58:54 +0200 - Keywords: devel

For those who wondered what I was up to, it’s now been 6 months since I started working as an R&D engineer at DONTNOD Entertainment, an awesome video game company. The studio is working on an AAA action-aventure game for HD consoles (PS3/X360) set in the near future, codenamed ADrift.

In case you want to join the fun, or know someone who does, we’re looking for a talented tools programmer. The responsibilities include:

The requirements for the position are:

The position is in Paris, France. If you are interested, you can directly send a resume to jobs at dont-nod dot com. If you want to know what it’s like working at DONTNOD, you can drop me an e-mail, but please understand that a lot of the information is company-sensitive and I cannot share it.

We are also looking for an audio programmer and 3D animators. Please refer to these job offers for more information.

gtkglarea 2.0.1 release

Posted on Sun, 19 Jul 2009 02:45:32 +0200 - Keywords: devel, gnome

We finally put together a new release of GtkGLArea, version 2.0.1. This version fixes Win32, Win64 and 64-bit Linux portability issues and numerous minor bugs. It can be downloaded from the GNOME FTP repository.

GtkGLArea actually consists in one simple library, libgtkgl. It provides three GTK+ extensions to manage OpenGL contexts: GtkGLArea, GdkGLContext and GdkGLPixmap.

Because it uses it in one of its commercial products, my previous employer sponsored the work my research team did on GtkGLArea. This disclaimer is the perfect opportunity to hint that GtkGLArea can be fit for production, including on the Windows platforms.

Mark my words

Posted on Wed, 1 Apr 2009 20:55:26 +0200 - Keywords: debian, devel, videolan

2009 will be the year of Linux on the desktop.

Bits from the DPL: FTP assistants, marketing team, init scripts, elections

Posted on Sun, 24 Feb 2008 13:17:04 +0100 - Keywords: debian, dpl

Not going to FOSDEM Hello, dear developers. I suppose many of you are currently at FOSDEM, but unfortunately I could not attend the event this year. Here are some news for you anyway!

FTP assistants

I am very pleased to let you know that yesterday Peter Palfrader (weasel) added Kalle Kivimaa (killer) and Thomas Viehmann (tviehmann) to the list of FTP assistants. I still hope that more people can be added soon to this team, but this is definitely good news.

Marketing team

At the various conferences I attended I have paid much attention to how other distributions and FOSS projects were promoting their work, and despite us often having t-shirts, stickers and posters like the others, we really miss a few things which would make Debian as appealing as other, dynamic projects.

I would like to set up a Debian Marketing Team, whose work would be to organise all the promotional stuff (logos, t-shirt designs, wallpapers, etc.) so that the project can officially endorse good designs, and to make the ultimate decision on visual stuff such as CD covers, splash screens, etc.

This team would have official DPL delegation, but I hope that it can also work with non-Debian-developers, as many packaging teams already do, because the non-DDs know better than us how to draw people to Debian. So please let me know if you are interested, even if you are not a DD, and especially if you are not a programmer!

I also would like to spend some Debian money on a contest, similar to the FreeBSD logo contest, to create a friendly mascot for the Debian project (in a similar way to the Linux penguin or the GNU gnu) that we can use where the logo is not enough. More on this in a few days.

Development news

Last month Petter Reinholdtsen (pere) gave some news about his project of improving the init system. This is almost as simple as adding LSB headers to your init scripts, and work is advancing towards this goal, though not as quickly as desirable. If your packages have init scripts, or if you wish to help, I urge you to have a look at the proposal so that we can have it in Lenny.

DPL elections

The new DPL term is in almost 2 months, but campaign starts next month. I have already stated that I would not run again, and haven't changed my mind. As many, many Debian developers are attending FOSDEM, I hope you can use some real-life meeting time to discuss the people you think would make good DPLs and tell them. Maybe they haven't thought of running (or re-running).

Being DPL does have an impact on your real life. If you are still wondering whether to run, or have any personal questions, feel free to ask me, I'll gladly share my experience.

Bits from India

Posted on Thu, 6 Dec 2007 20:08:31 +0100 - Keywords: debian, dpl

Incredible !ndia

As Christian already stated, we are currently in this lovely city with friendly people whom we French people have great trouble understanding, totally insane traffic and colourful taxis you find nowhere else, and dangerously spicy food. And no, it’s not Mexico City.

My first talk at FOSS.IN/2007 in Bangalore, India (Giving back to the community: how does Debian perform?) was an attempt at explaining to upstream developers what Debian did with their software, and where to proactively find information about the changes we do, the bugs that are reported, etc. I did this talk because Bangalore has this incredible ratio of software developers per square kilometer, while at the same time we have so few Indian DDs despite the 1.12 billion inhabitants. So I expected to find people doing much development but not necessarily familiar with Debian.

With Christian’s two other talks about translation works in Debian and how to contribute to Debian, we did quite a thorough coverage of Debian for a novice audience. My second talk, in the main conference track, will be on Saturday and will be an even more general presentation of Debian. Of course, my slides are not ready yet, what did you expect?

Debian business cards

There has been great interest in my Debian business cards, so I’m providing their SVG source (to be loaded and printed in Inkscape, for they make extensive use of the blur effect which is an Inkscape extension) for anyone interested. They use the Sexsmith and Sans Condensed Uralic fonts, available in Debian packages ttf-larabie-straight and ttf-uralic.

Sam’s Debian business card Sam’s Debian business card (back) Sam’s Debian business card (sample)

I don’t know enough about SVG scripting and object cloning, so to do the text shadow you will have to edit the same object twice. Sorry about that. Here are the files: background image (PNG), generic DD front (SVG), custom DPL front (SVG), back (SVG). The background image was cropped from Ayo’s Debian Expo wallpaper. The rest of the design should be considered public domain.

Just a note about the different languages I’ve been using at the back: I know I could have used more fancy languages with beautiful glyphs to show how truly universal our system is, but I did not know which to choose. So I just put the languages I personally vaguely understood.

Bits from the DPL: officialising delegations

Posted on Sun, 18 Nov 2007 18:10:16 +0100 - Keywords: debian, dpl

Hi there! There are a few delegations that I need to confirm or make official, so that we don't end up 5 years from now wondering when or how they happened.

First, Kalle Kivimaa (killer) was delegated Debian Auditor by the DPL last year and it was not completely obvious that delegation was to survive the end of Anthony's term. I am hereby confirming it is a permanent delegation (until resignation or future DPL decision).

Second, Peter Palfrader (weasel) was added to the team of Debian System Administrators (DSA). This is to be considered a normal delegation by the DPL.

And finally, Anibal Monsalve Salazar (anibal) was added to the Debian Maintainer Keyring team under the rules of the DM GR ("Changes to the team may be made by the DPL under the normal rules for delegations").

Bits from the DPL: DSA and a few other things

Posted on Sat, 3 Nov 2007 16:26:00 +0100 - Keywords: debian, dpl

I have been rather quiet during the last few months. Not really because I wasn’t doing anything, but because most of what I have been doing was done by private e-mail. Apparently people are expecting the DPL to disappear around the middle of their term, because I did not get many complaints. But yes, I know that sucked. And well, I now have a reason to regain motivation.

\o/ DSA++ \o/

Bananas 1Bananas 2Bananas 3

I am very, very pleased to let you know that this morning Phil Hands (fil) added Peter Palfrader (weasel) to the adm group. Which means that the DSA team now has a new member! The first since, wow, quite some time.

I am grateful to everyone who made this possible, for bearing with my insistance, for making concessions, for being patient, and I hope this is only the first step to bigger and better teams in Debian. Of course the path is still long but I must admit this is truly refreshing. I wish great success to Peter for the thankless job that awaits him.


After meeting Michael Man and several Sun people at Debconf and seeing Michael’s great talk I got really convinced that the technology present in OpenSolaris could benefit Debian in many ways. And the shortest path to there seemed to be Nexenta.

I am currently discussing the possibility of having a Nexenta machine accessible to Debian developers to port and test their packages. I also suggested the Nexenta people to submit patches directly to Debian and try to join friendly packaging teams. Please be nice to them!


Last month I attended Encuentro Linux 2007 in Arica, Chile where I gave a talk about the history and organisation of Debian and how to help and become a member of the project. Due to various issues (such as my passport being stolen when I was 2000 km away from the conference) I did not have the time to give my other planned talk about attracting developers who do not speak English to Debian and FLOSS projects.

Fortunately I was able to discuss it with members of the local communities. My goal is to understand why such a large Spanish-speaking area has so few Debian developers, and what we can do about that. One of my observations was that two very important documents (the Debian Policy and the Debian Developer’s Reference) were not translated into Spanish, while for instance there is a French translation of the latter. Any volunteers?

Bits from the DPL: DebConf, DSA

Posted on Mon, 11 Jun 2007 14:33:56 +0200 - Keywords: debian, dpl

on my way to EDI

I’m stopping for a few days in London before I continue to Edinburgh and I should arrive at DebCamp on Wednesday evening or Thursday morning, depending on whether we travel by train, bus or plane.

I’m really looking forward to seeing everyone and I hope to have enough time to talk about everything we want to do and set up this year, be it the game team or the core teams, the website or the technical committee...

DSA team

I eventually got feedback about DSA team candidacies from the various members of the current team. I am relieved that the very idea of adding more people was not met with too strong objections, but now who exactly is going to be accepted is a whole other story. I’ll keep you informed.

Bits from the DPL: FSF, expenses, DSA

Posted on Sat, 26 May 2007 02:13:46 +0200 - Keywords: debian, dpl

chat with the FSF

I had a nice talk with Peter Brown, FSF Executive Director and Brett Smith, Licensing Compliance Engineer. We mostly talked about the GPLv3, the GFDL and the Nexenta project.

The official GPLv3 launch is approaching very fast, and the FSF was wondering how Debian could play an active part in it. As I also said on debian-devel I am not eager to promote the use of this new licence until we know how much of our libraries are GPLv2-only. Any ideas about what Debian could do are of course welcome.

We didn’t talk much about the GFDL. The FSF’s absolute priority right now is the GPLv3, the GFDL will be addressed later. After last year’s GR Debian decided that works under that licence were free if they didn’t use unmodifiable sections. We are still waiting for a fix for the badly worded DRM clause, which the FSF told me they’re going to address. The Wikipedia project also has concerns with the GFDL so we should expect the licence to change a lot.

I opened a licensing questions ticket on May 16th to ask the FSF to clarify their position about the Nexenta and other OpenSolaris projects (full text available here). There are good chances that the answer will be in favour of allowing the redistribution, but it will take the FSF lawyers a few weeks to carefully write it down. I am personally enthusiastic about having this new port in Debian if possible.

disbursement of Debian funds

Around $4,300 USD (3,200 EUR) of Debian funds were spent or pledged to be spent this month, mainly on travel reimbursement for developers attending Debian meetings or representing Debian at various places. I will send any details to debian-private until I’m confident this is the kind of information I can really make public.

DSA team

Three weeks ago I posted about how not many people were proposing to help with the various core teams, and immediately got a lot more candidacies. Two weeks ago I sent a list and short description of 6 of these people to the current members of the DSA team for comment. Depending on what they are going to answer I’ll decide on what to do next.

I haven’t done anything similar about the other teams yet, apart from collecting proposals and ideas.

Bitten by Michael J. Hardy

Posted on Sat, 26 May 2007 02:10:45 +0200 - Keywords: debian, devel

If you have never heard the name Michael J. Hardy, you should read The Mike Hardy Saga. He seems to be a famous developer who “has released all sorts of software to the Internet: games, web browsers, and the like”. Without writing any of them.

Monsterz The one he took from me is Monsterz, a small python game, not terribly well written but quite addictive. And the page he did for his own version of that game (in fact he just added all the “Created By Michael J. Hardy” notices he could) is absolutely fantastic. This guy has balls. I especially love the “This Video Game is Dedicated to My Daughter...” notice.

Bits from the DPL: blog, talks, FTP-master

Posted on Mon, 7 May 2007 03:08:43 +0200 - Keywords: debian, dpl

blog posts

I am going to identify all my DPL-related posts with a “dpl” tag. All such posts will be accessible through http://sam.zoy.org/blog/?cat=dpl.


On May 5th I attended an Etch Install Party at the Carrefour du Numérique in the Cité des Sciences et de l’Industrie in Paris, organised by the Parinux LUG. Fellow developers Christian Perrier and Julien Cristau as well as not-yet-but-now-almost-really-soon-to-be developer Yves-Alexis Perez were also present.

I did a (rather dull, sorry; I didn’t prepare it well enough) talk about the Debian project, its organisation and how people, even beginners, can help Debian and its community. My slides (French) are available, and the Carrefour du Numérique people kindly recorded it and made it available for download.


Since the DPL elections I have given several interviews, of which a few have already been published. They may be of interest because I share my thoughts about topics that were not covered in my platform, or not very deeply. You can also check whether I am consistent. And it’s important that people know what I may say about Debian to the rest of the world. The interviews are:

FTP-master and other teams

Zobel is frustrated by things not happening in the FTP team which were apparently going better when AJ was DPL. I don’t really know how to understand that blog post. A DPL+FTP-master hat is something that cannot happen this year, so if this is what allowed AJ to be efficient we’ll have to find something else.

For the record, after my first bits from the DPL on debian-devel-announce and its “request for candidacy” I have received one offer to help the DSA team and one offer (this morning) to help with the NEW-handling part of FTP-master work.

Obligatory 契ȑ璝寣䇘앖噣삈

Posted on Thu, 3 May 2007 12:58:34 +0200 - Keywords: debian, devel, videolan

The proverb of the day is “契ȑ璝寣䇘앖噣삈” (pronounced “kulr’koykotsu huabszhoubbyiss” by anyone fluent in Mandarin, Serbo-Croatian, Korean and Japanese). I have no idea what it means, but it certainly has to do with knocking a hydra’s head, freedom of information or mediocre cryptographic design.

契ȑ璝寣䇘앖噣삈 (09f911029d74e35bd84156c5635688c0)

Oh, by the way: echo -n '契ȑ璝寣䇘앖噣삈' | iconv -t ucs-2le | hd

Use sshd and httpd on the same port (almost)

Posted on Mon, 23 Apr 2007 17:50:25 +0200 - Keywords: debian, devel

Running sshd on port 443 is common practice, because even in a very hostile environment full of firewalls and proxies that only allow web access, it is usually possible to use the HTTPS proxy to open a full TCP connection to port 443. I use this a lot. The problem is that I also want to run my SSL web server on the same IP. Here is a hack to do both.

One essential difference between the SSH and HTTP/HTTPS protocols is that upon connection the SSH server sends a banner to the client, while the HTTP and HTTPS servers wait for the client to send a request. Which means that after a reasonable amount of time, one can be fairly sure the client at the other end talks HTTP/HTTPS or SSH.

Due to recent interest in it, I’m publishing redirect.c, a small program that implements this technique. Use it at your own risk, and read about the limitations.

shlib-with-non-pic-code: have inline assembly and PIC mix well

Posted on Fri, 13 Apr 2007 04:52:19 +0200 - Keywords: debian, devel

Perhaps the most accessible documentation on what PIC code is and how an ELF dynamic linker works is John Levine’s Linkers and Loaders (and it has amazing sketches, too!). The Gentoo documentation also has an Introduction to Position Independent Code. I’d like to give a few hints on how to fix the shlib-with-non-pic-code lintian error caused by inline assembly on the i386 and amd64 platforms, as well as build errors that may occur due to inline assembly being used.

I’m not going to cover the trivial “all objects were not built using gcc’s -fPIC flag” problem. It usually requires a fix to the build system, not to the code.

gcc can’t find a register (i386)

PIC on i386 uses a register to store the GOT (global offset table) address. This register is usually %ebx, making it unavailable for use by inline assembly (and also restricting the compiler’s register usage when compiling C or C++ code). So the following perfectly valid code will not build with the -fPIC flag:

 void cpuid(uint32_t op, uint32_t reg[4])
    asm volatile("cpuid"
                 : "=a"(reg[0]), "=b"(reg[1]), "=c"(reg[2]), "=d"(reg[3])
                 : "a"(op)
                 : "cc");

Using -fPIC, gcc will say something around the lines of error: can't find a register in class ‘BREG’ while reloading ‘asm’. Several things need to be done to fix this:

And here is the PIC-compliant version:

 void cpuid(uint32_t op, uint32_t reg[4])
    asm volatile("pushl %%ebx      \n\t" /* save %ebx */
                 "cpuid            \n\t"
                 "movl %%ebx, %1   \n\t" /* save what cpuid just put in %ebx */
                 "popl %%ebx       \n\t" /* restore the old %ebx */
                 : "=a"(reg[0]), "=r"(reg[1]), "=c"(reg[2]), "=d"(reg[3])
                 : "a"(op)
                 : "cc");

using variables from assembly code (i386)

Directly using variables from inline assembly always creates non-PIC code even if -fPIC is being used. There are at least three strategies to consider when trying to fix this. Here is an example of PIC-incompatible code:

 extern uint32_t sym1, sym2, sym3;
 void store_in_symbols(uint32_t x)
     asm volatile("movl %0, sym1   \n\t"
                  /* ... */
                  "movl %0, sym2   \n\t"
                  /* ... */
                  "movl %0, sym3   \n\t"
                  : : "r"(x));

The first strategy is to pass the variable through the usual gcc inline assembly syntax. This is not always possible because there might be a shortage of registers, but here is what it looks like:

 extern uint32_t sym1, sym2, sym3;
 void store_in_symbols(uint32_t x)
     asm volatile("movl %3, %0   \n\t"
                  /* ... */
                  "movl %3, %1   \n\t"
                  /* ... */
                  "movl %3, %2   \n\t"
                  : "=r"(sym1), "=r"(sym2), "=r"(sym3) : "r"(x));

If there are too many variables and not enough registers, one can use the second strategy: put all required variables (or addresses) in a table, thus requiring only one extra register:

 extern uint32_t sym1, sym2, sym3;
 void store_in_symbols(uint32_t x)
     uint32_t tab[3];
     asm volatile("movl %1, (%0)   \n\t"
                  /* ... */
                  "movl %1, 4(%0)  \n\t"
                  /* ... */
                  "movl %1, 8(%0)  \n\t"
                  : : "r"(tab), "r"(x));
     sym1 = tab[0];
     sym2 = tab[1];
     sym3 = tab[2];

If the second method happens to be unsuitable because variable types differ too much, there is a third, more complicated strategy: retrieve the GOT address using some linker-specific magic, then use @GOT addressing to access variables:

 extern uint32_t sym1, sym2, sym3;
 void store_in_symbols(uint32_t x)
     uint32_t got;
     asm volatile("call get_got                               \n\t"
                  "get_got:                                   \n\t"
                  "popl %0                                    \n\t"
                  "addl $_GLOBAL_OFFSET_TABLE_ - get_got, %0  \n\t"
                  : "=r"(got));
     /* ... */
     asm volatile("pushl %%ebx                \n\t" /* save ebx */
                  "movl sym1@GOT(%0), %%ebx   \n\t" /* retrieve sym1 address */
                  "movl %1,( %%ebx)           \n\t"
                  /* ... */
                  "movl sym2@GOT(%0), %%ebx   \n\t" /* retrieve sym2 address */
                  "movl %1, (%%ebx)           \n\t"
                  /* ... */
                  "movl sym3@GOT(%0), %%ebx   \n\t" /* retrieve sym3 address */
                  "movl %1, (%%ebx)           \n\t"
                  "popl %%ebx                 \n\t" /* restore ebx */
                  : : "r"(got), "r"(x));

It is of course possible to merge the two above asm statements into one. However the performance implications of the GOT address retrieval should not be overlooked, especially if the assembly code takes place inside a critical loop, which means the loop might have to be unrolled and the GOT address retrieval done outside the loop.

Note also that _GLOBAL_OFFSET_TABLE_ is ELF-specific. On BSD and a.out systems you should use __GLOBAL_OFFSET_TABLE_. I am not aware of a way to do the same on Darwin / Mac OS X, which is a shame because it is the only widespread i386 platform where shared objects cannot be non-PIC.

gcc silently generates non-PIC code (amd64)

The amd64 architecture has the same problem as i386 when trying to access variables from assembly code. However, the solution is a lot easier: the GOT address can always be retrieved from the special %rip register. This is called rip-relative addressing:

 extern uint32_t sym1, sym2, sym3;
 void store_in_symbols(uint32_t x)
     asm volatile("pushl %%rax                       \n\t" /* save rax */
                  "movq sym1@GOTPCREL(%rip), %%rax   \n\t" /* retrieve sym1 address */
                  "movl %0,(%%rax)                   \n\t"
                  /* ... */
                  "movq sym2@GOTPCREL(%rip), %%rax   \n\t" /* retrieve sym2 address */
                  "movl %0,(%%rax)                   \n\t"
                  /* ... */
                  "movq sym3@GOTPCREL(%rip), %%rax   \n\t" /* retrieve sym3 address */
                  "movl %0,(%%rax)                   \n\t"
                  "popl %%rax                        \n\t" /* restore rax */
                  : : "r"(x));

amd64 also has more registers than i386, which makes the first discussed technique less prone to register shortage.

Why bother?

Good question.

Currently many shared libraries simply disable entire chunks of inline assembly on the amd64 architecture. Whether these routines bring any performance benefit compared to the C alternative is uncertain, but without being able to build the code there is no way to tell.

Even fewer developers care about i386, because this architecture can handle non-PIC shared objects quite fine (but then they are no longer really shared). I am in favour of making all shared objects PIC-friendly (ie. not necessarily build them as PIC if there is a valid reason not to, but at least don’t make it too difficult to build PIC versions) because that makes it easier to port the code to Darwin. I also believe the memory gain and especially the cache gain when using real shared libraries is underestimated.

Obligatory “yay for Etch” post

Posted on Tue, 10 Apr 2007 23:38:04 +0200 - Keywords: debian

Bananas 1Bananas 2Bananas 3

Etch is out! Thanks to everyone involved in the best release ever, and special congratulations for making this happen in 13 months less than for Sarge despite all the, er, obstacles. I’d personally love to see the trend continue for Lenny.

If you live in Paris, you have two opportunities to meet, have a beer and rejoice: tomorrow (Wednesday the 11th) and in three days (Friday the 13th). Everyone is welcome and you do not have to book, the place has plenty of room during the holidays. And if you live somewhere else, there’s probably a party near your place.

Election results

Posted on Mon, 9 Apr 2007 14:04:46 +0200 - Keywords: debian, dpl

Okay, I guess I’m expected to say something.

You’ll probably notice I’m not exactly bouncing around in a great explosion of joy. I’ll keep that for the upcoming obligatory “yay for Etch” post. As much as I’m saddened by a few reactions of perplexity or sometimes even bitterness, I hope the “ha, in your face!” attitude targeted at other candidates will eventually fade out, too.

I really didn’t think I would win (at least before all those people started e-mailing to tell me they voted for me). My initial goal was only to make people think I could win, so that other well-placed candidates would pick up the good stuff in my platform or adapt to it. I didn’t really care about me being DPL. Well, apparently this didn’t go exactly as expected and here I am.

That said, I’m of course happy that my candidate of choice won :-) And it’s good that we had more voters than last year. I’d also like to thank all other candidates for running. Despite disagreements and given how much I advocated teams in my platform, there’s obviously things we’ll be able to do together, I just don’t know the details yet. I have already been offered help on many topics, including from people with whom I’ve disagreed or even quarreled and that’s really heartwarming. It will be a great year.

For the datamining lovers here, you may want to use this alternate tally sheet that makes grepping more meaningful. Votes are rewritten as a comma-separated preference list: 3567,4,1289 means “ranked options 3, 5, 6 and 7 equally, then option 4, then options 1, 2, 8 and 9 equally” and could be a --19111-- or a 331211133 vote (which mean exactly the same to the voting software but not necessarily to the voter). To know for instance how many people ranked NOTA above all other candidates, use grep '^9,' (that’s 19 people, by the way). To know how many people put at least 5 candidates below NOTA, use grep '9.*,\([1-8].*\)\{5\}' (and that’s 119 people!).


Posted on Mon, 26 Feb 2007 14:34:28 +0100 - Keywords: debian

This is the percentage of me not caring about “noise [...] to make one’s point”.

Not to say that your work isn’t great and useful, Christian (it is). How about a nice chart of those figures instead?

Zzuf talk

Posted on Mon, 26 Feb 2007 14:31:28 +0100 - Keywords: debian, devel

If you missed my lightning talk about zzuf at FOSDEM, don’t worry: I missed it too. But the slides are online (sources too) and they should really be self-explanatory on how to start.

Just a little bit

Posted on Tue, 6 Feb 2007 11:52:27 +0100 - Keywords: debian

Simon: all right, let’s rock.

Exposing file parsing vulnerabilities

Posted on Tue, 16 Jan 2007 11:18:39 +0100 - Keywords: debian, devel, videolan

U FAIL Binary file parsing is difficult. There is a lot of byte swapping, offset computation and magic bit mask handling involved. Add to that the fact that many binary formats were reverse-engineered and do not even have a public spec, are so convoluted that there is no way to write a decent parser, or have so many buggy writer implementations that the readers need to accommodate for that.

Media players, web browsers and email clients are probably the most exposed ones. These programs are full of bugs, not more than any other program, but more dangerous bugs. Admit it, you just play any video you find on the Intarweb, click any image link and read your email (seriously, even mutt uses antiword to read .doc attachments). It is no longer necessary to have network listening services to be exposed to security issues, the users themselves listen to the world.

Using my fuzzing tool zzuf that I eventually decided to release, I found more than 40 bugs in common Unix tools, popular media players and other utilities, simply by reading valid files and slightly corrupting them. The most scary ones are the media player bugs:

VLCMPlayerxineFFmpeg (ffplay)GStreamer (gst-launch)mpg321ogg123
Ogg VorbisrobustSIGSEGVrobustSIGSEGVSIGSEGVN/Arobust
FLACrobustSIGSEGVrobustheap corruptionrobustN/ASIGFPE
Ogg TheorarobustSIGSEGVrobustSIGSEGVrobustN/AN/A

Each of these segmentation fault bugs is a potential security hole in Debian. zzuf also found bugs in Firefox, Openoffice.org, antiword, ImageMagick and even objdump. And there is more to come.

Holy freaking crap!

Posted on Tue, 9 Jan 2007 23:39:38 +0100 - Keywords: debian

Holy freaking crap! Under 100 RC bugs!

The Etch release... nah, just kidding

Posted on Wed, 20 Dec 2006 19:21:47 +0100 - Keywords: debian

ARM port is respawning too fast!


Wiibrator: Wiimote / Trancevibrator interface

Posted on Sun, 17 Dec 2006 14:52:02 +0100 - Keywords: devel


Wiibrator is a small Python application that interfaces the Wii’s Wiimote and the PS2’s Trancevibrator. Hours of fun for the kids!

Download the Python source here. You will need python-bluez and a Linux kernel with CONFIG_USB_TRANCEVIBRATOR activated (2.6.19 or higher).

The Etch release stress-o-meter

Posted on Mon, 11 Dec 2006 14:45:56 +0100 - Keywords: debian

The Etch release stress-o-meter

Phew, that was close, but everything is going on quite well now. Apologies to George Orwell.

Oh, the nullity

Posted on Fri, 8 Dec 2006 12:24:23 +0100 - Keywords: debian

Erich Schubert writes:

[A rather erroneous rebuttal of Anderson’s “new” tool]

Please. If you are going to use maths to refute a paper, at least read the paper, not the BBC news article.

In fact, dividing by zero can be useful in calculus. What the guy did is design a consistent system (I trust him at least on this) that resembles the IEEE floating point algebra, except that in his system Φ = Φ while NaN ≠ NaN. Such a distinction makes it possible to write and solve equations where Φ may be involved. Of course the final result may yield Φ but the important part is that it is consistent, proven, and remains valid whatever the input values.

What should be really questioned is:

Awesome blogging trick

Posted on Tue, 5 Dec 2006 23:09:45 +0100 - Keywords: blog, debian

Use categories! That’s right. Suppose for instance that you stopped contributing to Debian months ago and are enjoying your new fulfilling existence as a Slackware developer. You are obviously not only directly responsible for Etch being late due to your lack of involvement, but also contributing to the inane blogorrheic Slackware-only drivel that makes Planet Debian readers wonder why they subscribed to Planet Slackware.

So if Planet Debian uses your http://www.happy.slacker/blog/xml/atom10/feed.xml feed, you just need to replace it with http://www.happy.slacker/blog/xml/atom10/category/debian/feed.xml and all your articles tagged "debian" will appear on Planet Debian!

The Etch release (lol) stress-o-meter

Posted on Mon, 4 Dec 2006 00:00:19 +0100 - Keywords: debian

The Etch release (lol) stress-o-meter

The Etch release stress-o-meter

Posted on Thu, 30 Nov 2006 15:54:52 +0100 - Keywords: debian

The Etch release stress-o-meter

Dead LCD pixels

Posted on Fri, 20 Oct 2006 12:41:06 +0200 - Keywords: debian, devel

Dead LCD
 pixels Dear lazyweb, after 12 hours of displaying this animated GIF, the dead LCD pixel on my laptop disappeared. Probably worth a try.

Iceweasel FTW

Posted on Wed, 11 Oct 2006 16:15:16 +0200 - Keywords: debian

- - -=-=-=-=-=- Don't Delete Anything Between These Lines =-=-=-=-=-=-=-=-
[ 1 ] Choice 1: Re-affirm support to Eric Dorland, give Mozilla the finger
[ 3 ] Choice 2: Release Etch even with FireFox issues
[ 2 ] Choice 3: Further discussion
- - -=-=-=-=-=- Don't Delete Anything Between These Lines =-=-=-=-=-=-=-=-

Decision-making in Debian

Posted on Fri, 22 Sep 2006 16:13:45 +0200 - Keywords: debian

Quoting Raphaël Hertzog :

My long term project always involved that decision-making would be shared between the donors and all Debian developers.



Posted on Tue, 29 Aug 2006 12:57:25 +0200 - Keywords: debian

Dilbert can be so witty.

Best dinner ever!

Posted on Fri, 19 May 2006 08:26:42 +0200 - Keywords: debian

Holy crap, thanks to the great Tlaloc, eighth ruler of the days, ninth lord of the nights, almighty god of the rain and the lightning, supreme mariachi soaker, we had the best Debconf dinner ever. They even had my favourite Mexican dish.

Happy 1 month...

Posted on Thu, 6 Apr 2006 10:04:02 +0200 - Keywords: debian, devel

... to the ffmpeg packages, stuck in the NEW limbo for no apparent reason. Sigh.

Apple-VideoLAN partnership announced, Mac VLC to be Intel only

Posted on Sat, 1 Apr 2006 21:16:19 +0200 - Keywords: devel, videolan


Paris, France (2006/04/01) - In an effort to help Apple with its Intel transition, the VideoLAN team, distributor of the industry leading cross-platform media player VLC, announced its intent to drop support for the now outdated G4 and G5 based series of Mac computers.

“We had to do something for Apple in return,” former project leader Antoine Cellerier said in a public statement earlier today. Cellerier was referring to Apple’s stance against the French DADVSI law. The controversed law, voted in March 2006 by French MPs, seriously jeopardizes VLC’s development by forbidding French citizens to use software that bypasses Digital Right Management, such as DVD encryption or the protection scheme commonly found on music bought on the Internet.

But in late March 2006, Apple spokeswoman Natalie Kerris said the DADVSI law would “result in state-sponsored piracy.” Apple then threatened to take down its French iTunes Music Store.

Despite Apple’s tendency to send cease and desist letters to every website on the Internet, the VideoLAN team immediately understood that they were in fact trying to help Free Software. “After all, they built OS X on top of FreeBSD’s cremated remains, and used what could still be saved from KDE’s bloated web browser to develop Safari, which can only mean they fully embrace Open Source,” VideoLAN developer Sam Hocevar added.

The VideoLAN team hence announced that starting from the next release, VLC would only run on Mac Intel hardware. Apple is already ahead of schedule; the Mac Intels were originally announced for June of 2006, yet that mark was beaten by almost half a year. Apple is confident VideoLAN’s move will help finish the transition. “VLC is the most downloaded OS X application. By making it Mac Intel only, we can probably make the transition even faster. Let’s not repeat the PowerPC fiasco,” an Apple spokesperson said. The M68K to PowerPC transition, initiated in the 90s, led to the so-called “fat binaries” and excruciatingly slow versions of the Mac OS.

When asked how long older versions of VLC for the G4 and G5 series of processors would remain available, a VideoLAN webmaster said, “You’d better hurry. Our software is free, but webspace and bandwidth aren’t.”

About VideoLAN: VideoLAN (http://www.videolan.org/) is a project to build open source, cross-platform multimedia tools. Their VLC media player is the most downloaded Mac OS X application according to versiontracker.com.

About Apple: Apple is the creator of the hyped and overpriced Macintosh computer. Until recently, Apple buyers could brag in front of PC users about how their PowerPC-based computer was twice as expensive, but also twice as powerful as the Intel-based counterpart. Now, thanks to the Intel transition, Apple computers are only twice as expensive.

Arrêtez de me péter les couilles avec la cam 3D

Posted on Mon, 20 Mar 2006 15:46:11 +0100 - Keywords: devel

Bon, j’en ai un peu assez du buzz ridicule autour du pet project de Divide, une caméra 3D dont finalement personne ne sait ni comment elle marche ni finalement trop à quoi elle sert. Alors puisqu’on ne cesse de me parler de ce truc génial et de me demander ce que j’en pense, et que je ne peux pas poster sur le blog de Divide pour répondre aux insultes de ses potes, voilà quelques mots ici.

Ma rencontre avec Divide

Comme je l’ai constaté lors de ma rencontre le 19 mars avec Divide, il est très difficile d’avoir un discours s’adressant à la fois à des gens qui ne connaissent rien au sujet, à des gens qui s’y intéressent vaguement, et à des gens qui le maîtrisent, sans se faire taxer de condescendance, pédanterie ou d’imprécision.

C’est donc en toute bonne foi que je me suis permis d’expliquer tout au long de la discussion les concepts de géométrie épipolaire (qui, en passant, est à la base de toute la théorie de la reconstruction 3D), de wide baseline matching, ou de dispositifs catadioptriques. C’est sur cette dernière explication que Divide s’est levé outré et a décidé que la discussion devait s’arrêter là, s’en allant sans daigner me serrer la main. Je reste néanmoins convaincu que personne n’avait la moindre idée de ce dont je parlais, et que l’explication n’aurait pas fait de mal ; la famille des miroirs catadioptriques est très utilisée en vision parce qu’elle permet de résoudre des contraintes d’encombrement et de vision 360° sans trop perdre d’information. Mais bon, ça permettait à ceux qui croient que juger un travail signifie critiquer une personne de ne pas perdre la face, tant mieux pour eux.

Il m’est difficile de ne pas revenir sur le comportement de Vanth qui n’a pas cessé de me balancer des arguments d’autorité (me renvoyant systématiquement au CV de Divide et à son moteur 3D, qui franchement n’avait rien à voir avec la choucroute) ou d’homme de paille (m’attribuant les arguments d’autres personnes présentes pour me contredire et ignorer ce que je disais). Selon ce sinistre individu je ne serais venu « que pour dire “ton truc c 2 la merd, g vu dé gen y fon mieu alor di moi comen tu fé stp conar sinon lol je te di je te croi pa lol de mdr” », je suis un « zigoto », mon but est « clair » et consiste à « au passage insulter divide », je suis « très très [frustré] de voir quelqu’un [faire] mieux que [moi] », j’ai « tenté de lui soutirer des infos en tentant de rabaisser son travail », et le « truc quelconque » de Divide « [me] fait chier parce que la personne en question est meilleur(sic) que [moi] », et au final mon comportement a été « puéril et haïssable » (franchement, Divide, choisis mieux tes fanboys, celui-là te dessert plus qu’autre chose).

La caméra cachée

J’aimerais d’abord que tout le monde comprenne que je ne suis pas là pour descendre le boulot de Divide. Le boulot que je vois, je l’apprécie à sa juste valeur, je connais mon sujet. En revanche il ne faut pas non plus me prendre pour le couillon qui va avaler n’importe quoi, et en tant que scientifique il est normal (je dirais même indispensable) que je m’écrie “bullshit!” quand j’en vois. Donc autant je veux bien admirer ce qui a été fait, autant qu’on ne vienne pas me péter les couilles pour que je m’extasie devant une chimère, merci.

Alors cette caméra, d’abord, elle n’existe pas. Pas encore. Tout le monde le sait, mais ça vaut quand même le coup de le rappeler. Les « résultats » qu’on a vus utilisent en fait une photo. Et je mets « résultats » entre guillemets parce qu’on ne voit même pas la prise de vue originale, il est donc quasiment impossible de savoir ce qu’on va juger. C’est vraiment facile (ce mot est gentil ; dans une conférence n’importe qui dans le public dirait « malhonnête ») de montrer des « résultats » que personne ne peut tenter de reproduire. Je rappelle que ça n’est pas un comportement réservé au milieu de la recherche : dans l’industrie aussi, quand on rédige un brevet, on se fait envoyer chier assez vertement par le relecteur s’il n’y a pas d’état de l’art.

Un peu de reconstruction 3D

Pour le moment tout ce qu’il m’est donc permis d’apprécier c’est un algorithme de reconstruction 3D basé sur une prise de vue photo. Divide dit dans sa présentation « une photo », mais son algorithme est basé sur de la corrélation (ce qu’il appelle pixel matching et subpixel matching), c’est donc que sous une forme ou une autre il a au moins deux photos et non une seule, un peu comme la très classique paire d’images œil gauche / œil droit :

Tsukuba left Tsukuba right

Il est bien entendu possible que les prises de vue soient fusionnées d’une façon ou d’une autre, un peu dans ce genre (pour les curieux, la première est ce qu’on obtient avec un système catadioptrique à miroirs plans, la seconde avec un catadioptre courbe, du genre paraboles de révolution, et la troisième avec deux filtres rouge et cyan et deux miroirs plans, ça fera plaisir à certains):

Tsukuba upside-down Tsukuba polar Tsukuba red/cyan

Même dans ce cas on parle de deux (ou davantage) images, parce que la phase calculatoire passe forcément par un redressement des images (on dit « normalisation »). Comme on connaît les paramètres de notre ou nos caméras (distance focale, taille du capteur, colorimétrie), des systèmes optiques qu’on leur a mis au cul (miroirs), de l’écartement des centres optiques (virtuels ou non), etc., c’est pas trop difficile. Parfois on ne connaît pas tout (caméras libres, objectifs déformants, focale variable, etc.) et on est obligés de s’aider un peu de ce qu’on voit dans l’image pour calculer ces paramètres. L’ensemble de tous ces paramètres s’appelle la géométrie épipolaire et comme je l’ai déjà dit c’est la base. On peut bien entendu implémenter son algo directement sur les images non normalisées, mais c’est souvent se tirer une balle dans le pied, surtout dans la phase expérimentale.

Je reviens un peu sur l’image obtenue avec les filtres rouge/cyan (plus communément applée anaglyphe, je sais pas pourquoi j’ai bien envie d’en parler, sûrement parce que ça me rappelle Priscilla). L’intéret a priori c’est qu’on ne perd pas en résolution, puisque l’image conserve la même taille. On applique une transformation toute bête pour extraire l’information qui nous intéresse. Prenons l’exemple de Priscilla :

Priscilla anaglyph Priscilla red component Priscilla cyan component

Malheureusement, une fois cette séparation chromatique effectuée, on est quand même bien emmerdés, vous allez voir. On peut bien appliquer une formule nous donnant l’intensité des pixels en fonction de la couleur :

Priscilla red intensity Priscilla cyan intensity

On voit bien qu’on a perdu pas mal d’information dans la composante cyan et que les images sont beaucoup trop dénaturées, c’est manifeste dans les coudes. Lorsqu’on filme une scène avec d’excellentes textures bien contrastées (par exemple un feuillage) il y a de bonnes chances que ça se passe bien. Malheureusement dès qu’on filme un visage (aux teintes rosées), ou un objet aux couleurs très vives, le système se ramasse complètement. Idem pour le ciel, dont suivant la couleur on va être incapable de déterminer la profondeur même s’il est nuageux.

Bref, la séparation chromatique, même si ça marche pas mal pour le cerveau humain (et encore, on fait bien attention à ne pas utiliser de couleurs trop vives et proches des filtres qu’on utilise), ça ne marche quasiment pas en reconstruction 3D, ou alors pour des applications hyper spécifiques où on connaît a priori l’histogramme de la scène et les types de textures. Il vaut mieux diviser par deux la résolution X ou Y plutôt que de perdre des données vitales pour la reconstruction parce que l’objet devant la caméra a une sale couleur.

Donc voilà, Divide a son jeu d’images et il fait de la corrélation. Ça consiste à exhiber une fonction permettant de transformer une image du jeu en une autre, qui vérifie des propriétés intéressantes (de continuité, de robustesse, de cohérence visuelle...) et qui nous dit à la fin quels pixels (ou sous-pixels) de la première image correspondent à quels pixels de la seconde. Ensuite, grâce à la géométrie épipolaire, on peut par triangulation déduire la distance de chaque point de la scène à la caméra. Ça donne quelque chose comme ça par exemple :

Depthmap (scanline optimisation)

J’ai volontairement pris un algo ancien (datant des années 80) parce qu’il souffre des mêmes artefacts que les tous premiers essais de Divide, et montre en même temps que c’est bien du matching par ligne de pixels (peut-être ce qui s’appelle scanline optimisation) qu’il fait. D’autres algos plus sexy donnent ce genre de résultats :

Depthmap (belief propagation)

Il n’existe pas d’algorithme général qui marche à tous les coups. C’est illusoire non seulement mathématiquement, mais aussi pratiquement, parce que selon la scène il y a toujours une technique qui sera meilleure qu’une autre et ce ne sera jamais la même. Mais il y a bien entendu des techniques qui marchent super bien en moyenne.

Que vaut l’algo de Divide ?

C’est difficile à dire, bien entendu, puisque comme je l’ai déjà dit on n’a pas les images originales qu’il a employées pour sa reconstruction. Je peux en citer les points forts :

Parmi les points faibles, j’ai en tête :

Par ailleurs, sans en être certain, je doute qu’il y ait un support pour une fenėtre de corrélation variable (bien qu’il prétende que le système marchera tout aussi bien à 20 cm qu’à 10 km). Je ne peux pas juger le reste. De toute façon pour le moment il n’y a pas de reste. Bref, pour un système de caméra 3D, il y a pour le moment du code de corrélation qui me semble ma foi plutôt efficace, et... ben c’est tout. Donc pas vraiment de quoi vermifuger un abribus. En gros, les 5% les plus faciles ont été faits (et encore) et le reste va être d’un tout autre acabit :

Not impressed

Comme dit et redit, un système qui fait la même chose ça existe depuis des lustres et pour vraiment pas cher (un catadioptre à miroirs plans c’est peanuts) et ne pas le dire c’est soit naïf soit malhonnête.

Tant qu’il y aura ces petites phrases du genre « beaucoup plus d’applications, dans le cinéma, en médecine, voire dans le militaire » ou qu’à chacune de mes critiques on répondra « tu extrapoles sur le système » en balayant le reste avec dédain, et qu’on ne verra rien, je me gausserai.

Suspicious Activity? Indeed

Posted on Mon, 21 Nov 2005 02:26:13 +0100 - Keywords: devel, videolan

The Bad Plus I spent the whole weekend looking for a DRM-encumbered Sony CD so that I could check for myself whether my code was really being redistributed without permission. I eventually found one: Suspicious Activity?, by The Bad Plus. A rather enjoyable post-modern jazz album. I am lucky, it could have been Céline Dion.

As expected, installing the CD’s custom player also installed a stealth aries.sys driver along with a few other interesting files such as $sys$DRMServer.exe, all hidden in a $sys$filesystem directory. I rapidly got rid of this cruft and started studying the really important file, ECDPlayerControl.ocx. It is the file Sebastian Porst and Matti Nikki found to be containing parts of mpglib, LAME, faad2, VLC...

Suspicious Installer? Evidence that the DRMS code comes from VLC

There are of course obvious similarities between some functions and structures of ECDPlayerControl.ocx and the ones in VLC’s source. However, given how precise the implementation of a cryptographic protocol needs to be, the possibility that two separate implementations show many similarities must not be dismissed. The data structures and constant tables especially are likely to be identical. I think however that I found strong enough evidence that this is not the case here.

The original drms.c was written by Jon on 01/05/04. I then hacked on that file on 01/18/04 and reorganised it, also replacing the reverse-engineered MD5 and AES functions with clean implementations, then Jon added DRMSv2 support on 05/05/04 and I reorganised the code again on 05/08/04. Some of these changes were specific to VLC (not in that they made the code unusable outside of VLC, but rather that they made it possible to use an external MD5 hash provider, for instance), so they were the bits I was looking for in ECDPlayerControl.ocx.

For instance, Jon’s original code had the following instruction:

p_acei[ 4 ] = 0x5476212A;

Since all bytes of this long word are comprised between 0x20 and 0x7f, it was later rewritten like this:

char p_secret1[] = "Tv!*";

This change makes the code more human-readable because many other secrets in the Apple DRMS protocol are ASCII strings. Also, I know how to look for binaries that use the string "Tv!*", but it takes me some more time to think of a way to find binaries that use 0x5476212A. And the Sony rootkit uses the following (only relevant lines shown):

 .text:100883B8   mov   cl, byte ptr ds:xxxxx+4 ; 0
 .text:100883C2   mov   eax, dword ptr ds:xxxxx ; "Tv!*"
 .text:100883C8   mov   [esp+70h+yyyyy], eax
 .text:100883DC   mov   [esp+7Ch+zzzzz], cl

The use of xxxxx+4 shows that ECDPlayerControl.ocx uses a string instead of a 32 bits integer to store the secret, disregarding the fact that the 5th character of the string (a null char) is never used.

Another example: in this commit I reorganised the DoExtShuffle() function, merging FourthPass() and FifthPass() and discarding a structure allocated on the stack. What is important here is that DoExtShuffle() was built by a complex combination of choices, the main purpose of which being to reduce the size of the C functions:

 static void DoExtShuffle( uint32_t * p_bordel )
     uint32_t i_ret;
     i_ret = FirstPass( p_bordel );
     SecondPass( p_bordel, i_ret );
     ThirdPass( p_bordel );
     FourthPass( p_bordel );

Note how i_ret is not reused and could be merged into the p_bordel array, or maybe SecondPass() merged into FirstPass(). This choice is definitely a legacy of how the code evolved. And the Sony equivalent: a perfect match.

 .text:10089F3C xxxxx:
 .text:10089F3C   mov   ecx, esi
 .text:10089F3E   call  yyyyy
 .text:10089F43   push  eax
 .text:10089F44   mov   eax, esi
 .text:10089F46   call  zzzzz
 .text:10089F4B   add   esp, 4
 .text:10089F4E   call  ttttt
 .text:10089F53   call  uuuuu

After having studied the Sony code for a while, I have of course gathered dozens of such examples. But I also discovered a few new things.

Where does the DRMS code come from?

The code undoubtedly comes originally from VLC, but it has traveled a lot. I would be surprised if it came directly from VLC, as no other part of VLC is included with the rootkit. And although there are parts of FAAC in the Sony code and FAAC includes VLC’s drms.c, the version currently in the FAAC CVS is horribly outdated.

Sebastian Porst also noticed a few obvious differences between the Sony code and the version of drms.c present in VLC. The most obvious being this one:

 if( p_shuffle->i_version == 0x01000300 )
     DoExtShuffle( p_bordel );

Which became:

 .text:10089F2E   cmp   eax, 1000300h
 .text:10089F33   jz    short DoExtShuffle
 .text:10089F35   cmp   eax, 1000400h
 .text:10089F3A   jnz   short skip
 .text:10089F3C DoExtShuffle:
 .text:10089F3C   ...
 .text:10089F58 skip:
 .text:10089F58   ...

That 0x01000400 is a version check for 4th generation iPods firmwares. I also discovered at least 40 KB of new lookup tables that seem to be used for more buffer shuffling. At first I thought it was simply F4I’s DRM implementation, but the shuffling calls are nested with iPod hardware information retrieval from our DRMS code, so they’re really part of drms.c.

Sony distributing a DRMSv3 descrambler?

The only explanation I can think of is that someone took the VLC code, added support for an upcoming Apple DRMS format version and redistributed the software without letting the VLC authors know, probably violating the GPL (I only say that because I have not found the software yet, but I feel pretty safe in saying it).

Since it is based on GPL software, I was already entitled to ask Sony for the source code of ECDPlayerControl.ocx. But as the copyright holder of a significant part of the software they counterfeited, maybe I have a greater chance of being heard.

Not that it would be difficult to reverse-engineer it yet another time, but it would be awesome if the next opensource iTunes Music Store file player was contributed by Sony!

The fuss about Sony’s DRM

Posted on Fri, 18 Nov 2005 15:07:55 +0100 - Keywords: devel, videolan

Apparently some GPL code written by Jon and me can be found in Sony’s XCP DRM software. I have not been able to confirm this by myself (I went through the EFF’s list of Sony-BMG XCP-encumbered discs and The Dead 60s’ album seemed worth buying, but the only copy I could find in France is distributed by Deltasonic Records 2002 and did not go through Sony-BMG’s hands). I will however assume that the disassembly chunks published here and there are genuine, though this is something anyone in their right mind should check more thoroughly before blindly copying the information from blog to blog.

By the way, if anyone owns such a CD that they are willing to give away or sell, I am interested in owning at least one of them.

Is there really VLC code in XCP?

The short answer is yes. I have little doubt that the code is a derivative of VLC’s drms.c. The idea of ROT13’ing the Apple copyright string was Jon’s, and I know of no other clean-room reimplementation of Apple’s DRM.

However, it could pretty well be the code of another application that itself uses the drms.c code. It is virtually impossible to track the usage of GPL code, so the code in XCP could come from anywhere. And that other application could or could not violate the GPL, we have no idea either. The only ones who could enlighten us are First4Internet.

Is it a GPL infringement?

The first question that absolutely anyone should ask before drawing conclusions is: “are the code copying and redistribution terms really done without the authors’ consent?”. No one should ever assume anything about what Jon and I do with our code without making sure we did not relicense it to third parties under different terms.

But just to reassure everyone: I did not relicense any code from VLC under a non-GPL license.

Sony’s “evilness”

Again, we have no idea who the real culprit is, so do not draw conclusions too early. It could be:

And unless they were heavily trolling, I would like to publicly laugh at the Slashdork who decided not to buy a PS3 because of this story involving Sony. As if Microsoft’s Xbox 360 or Nintendo’s Revolution deserved it more.

The Apple copyright string

Just to make sure no one accuses Sony of violating Apple’s copyright, here is a copy of a comment I did on Slashdot about the presence of the ROT13’d string "copyright (c) Apple Computer, Inc.  All Rights Reserved.":

I have to make sure everyone understands why this string is here. To be fair with Sony (or whoever they mandated), it is not an attempt from them to hide the code theft. Rather, it is an attempt by Apple to prevent not only code theft but also clean-room reimplementations.

Apple’s encryption scheme includes the generation of a key. The important parts of this key come from the machine’s unique hardware information. But to prevent (at least that’s my only plausible explanation for it) people from reimplementing the scheme by using the same information, they also add this copyright string to the key generation. Reimplementing their protocol means the string has to be used.

We just store it ROT13’ed in VLC because it would be confusing to have an Apple copyright in our code. Although technically the string itself is created by Apple, it is too short to qualify for copyright.

Why do Sony’s CDs need to unscramble Apple’s iTune music?

I don’t think they need to do that. I think they just needed a free or low-cost media or music player shipped with their CD, and either VLC or some other software happened to fill the gap. The drms.c code just happened to be in there and no one bothered to remove it.

What now?

For those who expect hot sweaty action now, I am afraid I may disappoint you. The whole affair already gives Sony a very bad name, it raises public awareness of the dangers of stealth DRM and of the “respect our IP because we’re bigger than you, but we fuck with your IP because we’re bigger than you” doublespeak.

Lawsuits, or even large, friendly lawyer letters written in all caps, require money, time and energy. And I do not have any of these to waste. I prefer getting money from people who like what I do rather than from people whose doings I don’t like.

Finding a specific instance of a given day in the month in PHP

Posted on Thu, 10 Nov 2005 23:30:17 +0100 - Keywords: debian, devel

Andrew: to work out the fourth Thursday of the month, use this instead:

function nth_day($instance, $dow, $month, $year)
  $first_dom = date("w", mktime(0, 0, 0, $month, 1, $year));
  return 1 + ((7 + $dow - $first_dom) % 7) + 7 * ($instance - 1);

Or, using Zeller’s rule and avoiding function calls:

function nth_day($instance, $dow, $month, $year)
  if($month < 3) { $year--; } $D = $year % 100; $C = (int)($year / 100); $m = 1 + (($month + 9) % 12);
  $f = 1 + (int)((13 * $m - 1) / 5) + $D + (int)($D / 4) + (int)($C / 4) - 2 * $C;
  $first_dom = $f % 7;
  return 1 + ((7 + $dow - $first_dom) % 7) + 7 * ($instance - 1);

Update: thanks to Andrew for spotting the error in the second version. Due to my misunderstanding of a hack in Zeller’s rule, I had forgotten to decrease the year when the month was January or February. Also, PHP was not doing proper integer divisions and I had to cast results back to int despite all operands being ints.

Those spammers

Posted on Mon, 7 Nov 2005 12:08:33 +0100 - Keywords: captcha, devel

Quoting a gentleman in my inbox today:

> I need decoder that can decode most captchas in the blog
> software, I can use it from PHP, Quote me the price?

You’d think they’d try to hide their intentions a bit better.

Planet and my Atom feed

Posted on Sun, 30 Oct 2005 11:10:59 +0100 - Keywords: blog, debian

Okay, for all of you who made fun of me because my Atom feed broke planet.d.o with unnecessary HTML entities escaping, my feed is valid and every other agregator groks it, so I really think Planet is the culprit. Feel free to indicate a workaround that keeps the feed valid!

Monsterz, free games

Posted on Tue, 25 Oct 2005 17:40:54 +0200 - Keywords: debian, devel

Monsterz I managed to do a minor release of Monsterz that fixes compatibility issues with recent versions of Pygame and NumPy.

Unfortunately, despite my recent ITP, Monsterz cannot yet enter Debian due to license issues. I really tried my best to create and use completely free content, releasing the game and the graphics under the WTFPL and using a public domain module for the background music, but I still have problems with the sound samples. Two samples are under the CC-by 2.0 (which according to us is non-free, although very close to being free, which gives me good expectations for the next versions) and 8 other samples are “free and royalty free for commercial and non-commercial use”, which sadly does not explicitly allow modification. I already asked for clarification last year when I started gathering media for Monsterz, but got no answer.

And I did not just google for “free mp3s”, I really spent whole evenings hunting for the most freely licensed samples I could use. This shows exactly how difficult it is to find DFSG-free music and sound effects (as well as 2D and 3D graphics, but to a lesser extent from my personal experience). Though one possible reason may be that it is extremely easy to embed precise licensing terms within a program file, it makes me feel like coders are years ahead in terms of sharing their digital work for everyone to use and improve.

Of course, not being a professional sound engineer or creator, I am most certainly missing huge parts of the whole business equation, and I may underestimate the artistic bond they share with their work (and thus their reluctancy to give it away for minor to no retribution). But I do not believe that sound samples of a grunting alien or a bouncing ball may have a high artistic or pecuniary value. And though many people outside Debian will consider our license analyses mere nitpicking, a game designer would probably never use a sound sample that cannot be modified. But instead of just ranting and waiting for new versions of licences that never come in time (GFDL anyone?), I will just try to create my own replacement sound samples and give them away for free when done.

Forced semi-vacation

Posted on Wed, 19 Oct 2005 09:54:22 +0200 - Keywords: debian

My laptop is away for its 3rd motherboard change. I am hence unable to have much Debian activity, because it is my only computer that has a screen.

Is there a task organiser that does not suck?

Posted on Mon, 17 Oct 2005 02:54:27 +0200 - Keywords: debian

I managed to close 23 of my Debian bugs this weekend (including 5 RC ones), which is not bad at all. But I really need better organisation, I lack the ability to sort my bugs by personal priority, annotate them and keep a record of what I did about them, because the information is not always worth going into the BTS. What I currently do is pick up a package that has an RC or important bug, decide to work on it, and try fix its less important bugs while I am at it. Which means that I sometimes spend much time on an upstream bug or a feature request that are not that important. And no tool ever tells me “hey, bug #XXX is easy and affects more users, you should fix it before you work on that obscure m68k FTBFS.”

I have very strict requirements, and so far no tool has convinced me that it would do a better job than my plain ~/TODO file. And I really tried many of them, the console lover’s tool, the awesome new paradigm, the sticky notes, the complex GUI, and many, many more. In fact I have a very good idea of what would be good for me, but implementing that has a lower priority than most of my other work.

Being text-based or at least having a human-editable file format is an absolute requirement. I do not want to go through a GUI to do minor modifications. So far I have found hnb to be the most interesting tool for me. I will try to get used to it.

Moving away from Advogato

Posted on Tue, 11 Oct 2005 09:18:08 +0200 - Keywords: blog, debian

I eventually moved my Planet Debian feed away from Advogato to my old .plan file that now has an RSS feed. I had not been posting very much on Advogato for the last two years anyway, mostly because it did not let me sort the feed by keywords. Everything I posted was appearing on Planet Debian but I would like to be conservative about what I send and stick to Debian-related content here.

Of course I still have my LiveJournal to tell the universe how much I like blogs.

Advogato is still a very interesting place. It is quite dormant nowadays and has lost the initial momentum now that everyone has their own blog, but the content remains reasonably on-topic and there are quite a few skilled people who still use it as their main developer’s diary.

Taking over libmpeg2

Posted on Mon, 10 Oct 2005 23:42:26 +0200 - Keywords: devel, videolan

Meuuh and I eventually took over libmpeg2, in a totally friendly way. Our first job will be to review every patch that was submitted in the last 18 months. The biggest work will be, as with libdvdcss, to deal with MPlayer’s usual inability to split a patch into functional subsets.

Opening my non-blog

Posted on Mon, 10 Oct 2005 21:11:35 +0200 - Keywords: blog

I have been avoiding blogs as much as I could ever since they became fashionable. I found them uninteresting. Most of them were slight variations of the everlasting alternation of friends’ (or children’s, or pets’) pictures and reports of how the day before (or yesterday’s movie, or life) was great (or sucked, or was utterly boring). I did not read them, but they started invading my life nonetheless, spamming search engines and diluting information. But I could cope with the Google noise and just ignore blogs.

Then, blogs started to carry opinions, not just feelings. They are now seen by many as a new kind of journalism, yet most of them suffer from the obvious bias that the entry poster is the same person as the comment moderator. Having been banned countless times from Slashdot for bashing moderators or simply attacking the general groupthink, I was not surprised at all to see a few of my comments removed from many blogs. How could I not hate blogs as a means of communication? In mailing-lists or on Usenet, when people disagree with you, they answer and argue, they don’t remove your messages. Blogs have become the most selfish variation of the web bulletin board. But I could still cope with the spread of flawed information and just ignore blogs.

Then, blogs started to build communities. You can only be part of the community if you are a blogger. Well, it would prove astonishingly difficult for me to care less about blogger communities (though I might try). If the community is about having a blog, then I am perfectly happy with the numerous communities I am a part of that are not about me having a blog and I can just ignore blogs.

But today, I have a problem. Even within tech-savvy communities such as the Debian developers, discussions can occur that are not taking place in the common channels (such as the mailing-lists) but on blogs. There are people who are following Planet Debian but not the debian-devel mailing-list. And the reason can definitely not be that debian-devel is full of noise or flamewars: it is incredibly easy to kill a thread in a mailing-list, whereas it is virtually impossible to filter out the new fucking blog meme that spreads everywhere and about which I do not care. Also, people no longer subscribe to mailing-lists, it seems too tedious. Instead, they prefer to hammer RSS feeds every fucking five seconds to know whether something new just happened. So, here it is, my non-blog. My RSS-feed-without-a-blog. You can subscribe to it if you are too lazy to get informed through the other channels about libcaca releases, my Debian bugs, PWNtcha development, my work on VideoLAN, the next talk I am giving. It appears nowhere on my webpage but you can still subscribe to it.


Posted on Fri, 9 Sep 2005 11:55:45 +0200 - Keywords: devel

I hate OpenOffice with my guts.


Posted on Mon, 6 Dec 2004 11:47:21 +0100 - Keywords: debian, devel

I could not help but add my little contribution to the fantastic Hot-Babe debate.

Show the last 10 | 20 | 50 entries.