Multiverse Debugging: Non-Deterministic Debugging for Non-Deterministic Programs

We have been working on various bits and pieces to improve debugging in the past. For example, we tried to understand what bugs are possible, how debugging of actor systems works, how we could support all kind of concurrency models in debuggers, and more recently, how to avoid some issues with non-determinism by recording and replaying the execution of buggy actor applications.

Though, one of the big issues with debugging is that non-determinism makes it practically impossible to see what a program could be doing at any given point in time. Debugging a sequential program, we can see what is happening in every moment, and for most parts, programs are deterministic and will do the same thing reliably for a give point in a program. But with non-determinism in the mix, even with a debugger, we can’t be sure what a program would do the next time we inspect it. Non-determinism can cause for instance operations to be scheduled differently or messages to arrive in a different order. This means, we can’t really just go and look at a program in a debugger to see what it would be doing.

So, what if we could see all concurrency bugs in the debugger? What if we could simply explore the different non-deterministic paths a program could take?

With Multiverse Debugging, we explore exactly that idea.

Based on the AmbientTalk language, we designed and built a debugger that allows us to explore all possible universes, i.e., states a program can reach. Instead of staying in a single universe, we can ask the What If? question at every point in our programs and start exploring what may happen if messages are received in different orders, actor B is scheduled before actor A, and how the final results of such non-deterministic variations differ.

To get an idea of how that could look like, see the demo video below, come to our ECOOP’19 presentation next Thursday, or talk to us during the ECOOP poster session!

So far, it is early work, and a brave new idea paper, but despite various challenges ahead, we think it can make a difference.

You can find the abstract and preprint of the paper below.

Abstract

Many of today’s software systems are parallel or concurrent. With the rise of Node.js and more generally event-loop architectures, many systems need to handle concurrency. However, its non-deterministic behavior makes it hard to reproduce bugs. Today’s interactive debuggers unfortunately do not support developers in debugging non-deterministic issues. They only allow us to explore a single execution path. Therefore, some bugs may never be reproduced in the debugging session, because the right conditions are not triggered. As a solution, we propose multiverse debugging, a new approach for debugging non-deterministic programs that allows developers to observe all possible execution paths of a parallel program and debug it interactively. We introduce the concepts of multiverse breakpoints and stepping, which can halt a program in different execution paths, i.e. universes. We apply multiverse debugging to AmbientTalk, an actor-based language, resulting in Voyager, a multiverse debugger implemented on top of the AmbientTalk operational semantics. We provide a proof of non-interference, i.e., we prove that observing the behavior of a program by the debugger does not affect the behavior of that program and vice versa. Multiverse debugging establishes the foundation for debugging non-deterministic programs interactively, which we believe can aid the development of parallel and concurrent systems.