If I saw nothing there which revealed a Divinity, I would come to a negative conclusion; if I saw everywhere the signs of a Creator, I would remain peacefully in faith. But, seeing too much to deny and too little to be sure, I am in a state to be pitied; wherefore I have a hundred times wished that if a God maintains Nature, she should testify to Him unequivocally, and that, if the signs she gives are deceptive, she should suppress them altogether; that she should say everything or nothing, that I might see which cause I ought to follow.

Blaise Pascal, Pensées, #229

09.12.11

Lying system calls

Posted in Linux, Software Development at 8:46 pm

Only Debian hackers are likely to grok this.

I just spent a week, maybe more, trying to look into a variety of very bizarre build failures for some packages, after building and installing newer versions of coreutils, dpkg and debhelper. Things like “install -d” dying because its destination wasn’t a directory (I’d check afterwards, it was), tar complaining about a file changing out from under it (always about symlink files, where the block of code in tar that could generate that error could never be evaluated for symlink files), and dpkg-deb –build complaining that a pre-installation script wasn’t executable, when it clearly was.

Of course, I was mostly treating these as separate, bizarre problems that happened to start up within a similar timeframe. Tonight it suddenly dawned on me that maybe all these system calls appear to be lying to me, because they are. They are, and building a package in fact typically involves running a program whose job is specifically to make system calls lie: “fakeroot”.

Fakeroot is of course only intended to lie just enough so that programs think they’re running as root, even though they really aren’t. But fakeroot’s documentation clearly states that it will not work correctly if the programs running underneath it are linked against a different version of the system libraries. The seeds of this problem were sown some years ago when we built and installed a newer version of libc6, but the problem didn’t manifest itself until now, because the most commonly-used utilities for building packages are dpkg, debhelper, and coreutils, all or most of which were not updated until I updated them just a week or so ago. Gah!