-
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…
-
The PhD Grind, and Why Research Isn’t Like Sex
Phil Guo’s short online book, The PhD Grind, is the best description of the modern PhD experience in CS that I know of. People working on, or thinking about working on, a PhD in CS should read it. In this post I just want to comment on a few things. Phil vividly describes the sinking feeling that…
-
Burning in a Module with Random Unit Testing
Sometimes a class or subsystem makes us uneasy; when something goes wrong in our software, we’ll immediately suspect the shady module is somehow involved. Often this code needs to be scrapped or at least refactored, but other times it’s just immature and needs to be burned in. Randomized unit testing can help with this burn-in process,…
-
Slightly More Sensible Signed Left-Shifts in C11 and C++11
Left-shift of signed integers in C99, C11, and C++11 is difficult to use because shifting a 1 bit into or past the sign bit (assuming two’s complement, of course) is an undefined behavior. Many medium and large C and C++ programs do this. For example, many codes use 1<<31 for INT_MIN. IOC can detect this…
-
The Central Limit Theorem Makes Random Testing Hard
I believe that the central limit theorem provides a partial explanation for why it can be very difficult to create an effective random tester for a software system. Random testing is carpet bombing for software: the more of the system you can hit, the better it works. The central limit theorem, however, tells us that…
-
1500+ Bugs from One Fuzzer
This metabug links to all of the defects found in Firefox’s JavaScript engine by jsfunfuzz. The surprise here isn’t that bugs were found, but rather that more than 1500 bugs were found in a single language runtime by a single test case generator. I’m interested in exactly what is going on here. One possibility would be…
-
Announcing C-Reduce: A Better Test-Case Reducer for C/C++ Compiler Debugging
Test-case reduction means taking a large input to a computer program (for compiler debugging, the input is itself a program) and turning it into a much smaller input that still triggers the bug. It is a very important part of the debugging process. Delta, an excellent open-source implementation of the delta debugging algorithm ddmin, has been the test-case reduction…
-
Street Fighting Computer Science
One of my favorite recent books is Street Fighting Mathematics: a collection of techniques and heuristics for rapidly and roughly estimating the solutions to problems that may be very difficult to solve exactly. The book is important because estimation is incredibly useful for understanding the world and because our education system does not do a very…
-
Academic Bug-Finding Projects in the Long Run
A number of computer science researchers, including me, have made careers out of creating tools that automate, at least partially, the process of finding bugs in computer programs. Recent work like this can be found in almost any good systemsy conference proceedings such as SOSP, OSDI, ASPLOS, ICSE, or PLDI. Examples go back many years,…