Author: regehr

  • The Little C Function From Hell

    The other day a student and I were trying to understand a subtle part of the C standard. Often, the easiest way to clarify this kind of issue is to recognize that compiler writers have already grappled with it — so just write some code and see what various compilers do with it. I wrote…

  • Better Testing With Undefined Behavior Coverage

    [The bit puzzle results are based on data from Chad Brubaker and the saturating operation results are based on data from Peng Li. They are respectively an undergrad and a grad student in Utah’s CS program.] Klee is a tool that attempts to generate a collection of test cases inducing path coverage on a system…

  • Undefined Integer Behaviors in Student Code, Part 2

    [This post is based on data gathered by my student Peng Li. He also wrote the undefined behavior checker.] The other day I posted about undefined integer behaviors in code written by students in a class I used to teach. This post is more of the same, this time from CS 5785, my advanced embedded…

  • How to Write a C/C++ Compiler That Respects Volatile

    The volatile type qualifier in C/C++ means roughly that accesses to the qualified object happen on the actual machine as they do in the abstract machine. I’ve written about volatile pretty extensively, so won’t repeat myself. An interesting problem with volatile is that in practice, compilers fail to respect it: they add, remove, and reorder…

  • Life With BibTeX

    For a while I’ve had a blog post about BibTeX on the back burner, but now I don’t need to write it because Dan Wallach has done so. It’s a great post, but for emphasis I’ll repeat a handful of points that I tell students (and would like to tell authors of some papers I…

  • Differential Whitebox Testing Is Good

    [This post is based on data gathered by Chad Brubaker and Peng Li, respectively an undergrad and grad student in CS at Utah.] Two courses I’ve taught at Utah, CS 4400 and CS 5785, have assignments where students write short integer functions for which we — the instructors — have automatic graders. In 4400 the…

  • Quality Not Quantity?

    The perverse incentives for academics to maximize publication and citation counts, as opposed to maximizing the quality and impact of the underlying research, are well-known. Stan Trimble’s recent letter to Nature suggests a partial solution: academic institutions should limit the number of publications that are part of a tenure or promotion case. This is simple…

  • Visualizing A Few More Math Bugs

    As a followup to last night’s post, here are some saturating signed subtraction functions I’ve received. Hopefully the correct one is obvious.

  • Visualizing Math Bugs

    After getting too tired to work tonight, I realized I had no Netflix and that I’m bored with the books I’m reading. Therefore, I present visualizations of several solutions I’ve received to my saturating arithmetic homework over the years. This is what a correct saturating signed add looks like, where the z-axis is the output:…

  • A Few Thoughts About Path Coverage

    Klee isn’t the only tool in its class, nor was it the first, but it’s open source and well-engineered and it works. Klee’s goal is to generate a set of test inputs that collectively induce path coverage in a system under test. One of the scenarios I was curious about is the one where Klee…