InitRacer

This tutorial describes how to use the InitRacer tool, presented in the paper "Practical Initialization Race Detection for JavaScript Web Applications" (in Proc. OOPSLA 2017).

This artifact consists of:

  1. an Ubuntu 16.04.1 virtual machine (vm.ova [recommended], vm.zip), where InitRacer and all of its dependencies have already been installed,1,2 and
  2. the source code of InitRacer (GitHub).

The page Getting started describes how to run a quick experiment to check if everything works as it should.

The page Usage instructions describes how — based on the virtual machine — to reproduce the results from the OOPSLA 2017 paper, and how to apply InitRacer to a new input.

The page Install instructions describes how to install InitRacer on a fresh Ubuntu 16.04.1 machine (i.e., how to derive the virtual machine that has already been prepared).


1The username and password of the virtual machine is "initracer".

2If the virtual machine crashes, try disabling 3D acceleration.

Getting started

The reader may choose to use the pre-configured virtual machine, or follow the install instructions. To use the pre-configured virtual machine vm.ova, open VirtualBox and import vm.ova via "Import Appliance..." in the File menu. Alternatively, unzip vm.zip. Then create a new Ubuntu (64-bit) virtual machine in VirtualBox, using the existing virtual hard disk file initracer-artifact-final/initracer-artifact-final-disk1.vdi.

We recommend using the following VirtualBox settings for the virtual machine:

  • System → Motherboard → Base Memory: 8192 MB
  • System → Processor → Processor(s): 4 CPUs
  • Display → Screen → Video Memory: 128 MB

InitRacer has been installed in the directory ~/initracer/ in the virtual machine. The usage instructions on this page are relative to this directory. Hence, start by opening a terminal and stepping into this directory:

cd ~/initracer/

Detecting the errors in Section 2 (Motivating Examples)

For the reader's convenience, a report for the three websites is available at motivating-examples/.

Reproducing the results using InitRacer

  1. Issue the following script to execute InitRacer on (the recordings of) https://www.aetna.com/, http://www.apple.com/, and http://www.mckesson.com/.

    ./run-experiments.sh motivating-examples.sh

    In the authors' experience, this step takes 15-20 minutes (due to the validation of 35 access-before-definition warnings on https://www.aetna.com/).

    It is also possible to execute InitRacer on only one of the websites as follows (approx. 1-3 minutes):

    ./run-experiments.sh "initracer.js --site apple.com --url http://www.apple.com/"

    The user should not attempt to interact with the web pages while InitRacer is running its analysis.

    Please note that some failures may be logged to the terminal (due to flakiness involved in using Protractor). InitRacer will automatically retry the execution when this happens.

  2. View the report by issuing the command http-server, and opening http://localhost:8080/report/ in a browser. The following pages correspond to those that are mentioned above:

Usage instructions

Just getting started? Check Getting started.

Reproducing the quantitative results in Section 6 (Evaluation)

For the reader's convenience, a report for the 100 websites is available at experiments/. The quantitative results that have been reported in Section 6 (Evaluation) are easily reproduced, since the subsections "RQ1: Number of Reported Warnings" and "RQ2: Performance" are automatically generated, and shown on experiments/, along with Table 1.

Due to small regressions the results have improved slightly since the submission — the authors plan to update the results reported in the paper to reflect this.

Reproducing the results using InitRacer

  1. Issue the following script to execute InitRacer on (the recordings of) the websites of the 100 largest companies from the Fortune 500 list.
  2. ./run-experiments.sh

    In the authors' experience, this step takes 4-4.5 hours. Notice that the script has been designed to continue from where it left off in case it is interrupted (e.g., the virtual machine crashes). A fresh run can be obtained by deleting the out/ folder (rm -rf out/).

  3. View the report by issuing the command http-server, and opening http://localhost:8080/report/ in a browser.

Applying InitRacer to a new input

  1. InitRacer can be applied to a new web page by issuing the following command.

    ./initracer.js --site <ID> --url <URL starting with http:// or https://> [--validate]

    The argument --validate is optional, and specifies that the more expensive validation execution mode should be run as well.

  2. View the report by issuing the command http-server, and opening http://localhost:8080/report/ in a browser. The summaries should contain a row named ID. If this row does not show up, make sure that it is not due to the browser cache. The individual report for ID is available at http://localhost:8080/report/#/ID.

Install instructions

Instructions for installing InitRacer and its dependencies are available in the README.md from the GitHub repository. This page repeats these instructions for the reader's convenience.

The following install instructions have been tested on Ubuntu 16.04.1, and can be used to derive the virtual machine that has been included with the InitRacer artifact.

Installing dependencies

  1. Install Google Chrome from https://www.google.com/chrome.

  2. Install other dependencies by issuing the following commands.

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y git nodejs python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev g++
    sudo npm install -g http-server protractor@5.0.0
    sudo webdriver-manager update
    pip install mitmproxy==0.17
  3. Install the mitmproxy certificate, by following these steps.

    1. Start mitmproxy by issuing the command mitmdump.
    2. Open http://mitm.it/ in Google Chrome by issuing the following command (notice the --proxy-server argument):

      google-chrome-stable http://mitm.it/ --proxy-server="127.0.0.1:8080"
    3. Download the mitmproxy certificate mitmproxy-ca-cert.pem for Ubuntu by clicking on "Other".

    4. Install the mitmproxy certificate: Open chrome://settings/certificates in Google Chrome, click on "Authorities", and import the certificate mitmproxy-ca-cert.pem. In addition, issue the following commands.

      sudo cp ~/Downloads/mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt
      sudo update-ca-certificates
    Test that the mitmproxy certificate is installed correctly, by repeating steps (A) and (B), and opening https://github.com/ in the browser.

Installing InitRacer

  1. Issue the following commands to install InitRacer.

    git clone https://github.com/cs-au-dk/initracer.git
    cd initracer
    npm install
  2. Preparation for reproducing the experiments: Unzip the file recordings.zip from the artifact (also available here), which contains the recordings of the websites of the 100 largest companies from the Fortune 500 list, into the initracer/ directory.

    unzip recordings.zip -d ~/initracer/