anchor.diff:  
             // Close stdin so that tests that try to block on input will fail.
             process.stdin.close();
  -          void timeoutHandler() {
  +          timeoutHandler() async {
               timedOut = true;
               if (process != null) {
  +              var executable, arguments;
                 if (io.Platform.isLinux) {
  -                // Try to print stack traces of the timed out process.
  -                io.Process.run('eu-stack', ['-p ${process.pid}'])
  -                .then((result) {
  -                  io.stdout.write(result.stdout);
  -                  io.stderr.write(result.stderr);
  -                })
  -                .catchError(
  -                    (error) => print("Error when printing stack trace: $error"))
  -                .whenComplete(() {
  -                  if (!process.kill()) {
  -                    DebugLogger.error("Unable to kill ${process.pid}");
  -                  }
  -                });
  +                executable = 'eu-stack';
  +                arguments = ['-p ${process.pid}'];
                 } else if (io.Platform.isMacOS) {
                   // Try to print stack traces of the timed out process.
                   // `sample` is a sampling profiler but we ask it sample for 1
                   // second with a 4 second delay between samples so that we only
                   // sample the threads once.
  -                io.Process.run('/usr/bin/sample',
  -                               ['${process.pid}', '1', '4000', '-mayDie'])
  -                .then((result) {
  -                  io.stdout.write(result.stdout);
  -                  io.stderr.write(result.stderr);
  -                })
  -                .catchError(
  -                    (error) => print("Error when printing stack trace: $error"))
  -                .whenComplete(() {
  -                  if (!process.kill()) {
  -                    DebugLogger.error("Unable to kill ${process.pid}");
  -                  }
  -                });
  -              } else {
  -                if (!process.kill()) {
  -                  DebugLogger.error("Unable to kill ${process.pid}");
  +                executable = '/usr/bin/sample';
  +                arguments = ['${process.pid}', '1', '4000', '-mayDie'];
  +              }
  +
  +              if (executable != null) {
  +                try {
  +                  var result = await io.Process.run(executable, arguments);
  +                  diagnostics.addAll(result.stdout.split('\n'));
  +                  diagnostics.addAll(result.stderr.split('\n'));
  +                } catch (error) {
  +                  diagnostics.add("Unable to capture stack traces: $error");
                   }
  +              }
  +
  +              if (!process.kill()) {
  +                diagnostics.add("Unable to kill ${process.pid}");
                 }
               }
             }
  
positive.code:   int pid;
    OutputLog stdout = new OutputLog();
    OutputLog stderr = new OutputLog();
    bool compilationSkipped = false;
    Completer<CommandOutput> completer;
  
  
negative.code:         new DateTime.now().difference(startTime),
          compilationSkipped,
          pid);
      commandOutput.diagnostics.addAll(diagnostics);
      return commandOutput;
    }
  
  