Month: July 2012

  • It’s Time to Get Serious About Exploiting Undefined Behavior

    [Note: I promise, this is almost my last post about undefined behavior for a while. Maybe just one more in the queue.] The current crop of C and C++ compilers will exploit undefined behaviors to generate efficient code (lots of examples hereĀ and here), but not consistently or well. It’s time for us to take this…

  • Undefined Behavior Consequences Contest Winners

    The contest that I posted the other day received some very nice entries. I decided to pick multiple winners since the best entries illustrate consequences of several kinds of undefined behavior. First, here’s the runner up, submitted by Octoploid: This program is undefined by C99, where signed left shifts must not push a 1 bit…

  • Twenty Years of Linux

    Twenty years ago, almost to the day, my friend Jamie showed up with four floppy disks. Two of them were a boot/root pair for 386BSD (none of FreeBSD, NetBSD, or OpenBSD existed yet) and two of them were for Linux 0.96c. It’s pretty hard to overstate how cool and amazing it was to see protected-mode…

  • Anniversary Hike

    Sarah and I have been married for 11 years today; we celebrated by going hiking with the kids up at Alta, where our wedding was. Unfortunately, after a couple of hours of great conditions, a cold rain storm reminded us that weather in the mountains can be serious. At least there was no lightning! We…

  • Contest: Craziest Compiler Output due to Undefined Behavior

    [UPDATE: Winners are here.] The C and C++ standards fail to assign a meaning to a program that overflows a signed integer or performs any of the 190+ other kinds of undefined behavior. In principle, a conforming compiler can turn such a program into a binary that posts lewd messages to Twitter and then formats…

  • Parallelizing Delta Debugging

    Delta debugging is a technique for taking an input to a computer program that causes the program to display a certain behavior (such as crashing) and automatically creating a smaller input that triggers the same behavior. For complex programs that typically process large inputs (compilers, web browsers, etc.) delta debugging is an important part of…

  • Scooping and New Publication Models

    If I come up with a great new research idea, sit on it for a couple of years, and then someone else publishes it before I do, then I got scooped. This is unfortunate but as long as the ideas were developed independently, nobody has done anything wrong. Of course, in the real world, establishing…

  • When is Undefined Behavior OK?

    Under what circumstances is it acceptable for a programming language to admit undefined behaviors? Here I mean undefined behavior in the C/C++ sense where, for example, “anything can happen” when you use an uninitialized variable. In my opinion, five conditions need to be fulfilled. First, the undefined behavior must provide a significant, robust performance win.…

  • Academic Attention for Undefined Behavior

    Undefined behaviorsĀ are like blind spots in a programming language; they are areas where the specification imposes no requirements. In other words, if you write code that executes an operation whose behavior is undefined, the language implementation can do anything it likes. In practice, a few specific undefined behaviors in C and C++ (buffer overflows and…