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:

Today, the Internet will be full of bullshit.

Coder wanted at DONTNOD Entertainment

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

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

Simon: all right, let’s rock.

Show the last 10 | 20 | 50 entries.