Skip to content

whoisutsav/cancellation-study-osdi

Repository files navigation

Artifact overview

Contained in this repo are artifacts related to Submission #118 in OSDI '22, "Cancellation in Systems: An Empirical Study of Task Cancellation Patterns and Failures".

There are three parts to the artifact: cancel feature requests dataset, cancel issue requests dataset, and queries used to detect cancel-antipatterns.

1. Cancel feature requests dataset

Contained in file CancelFeatureRequests.xlsx.

This dataset is the foundation of section 4, "Why Do Applications Cancel Tasks" and the summary corresponds to Table 3 of the submitted paper.

2. Cancel issue requests dataset

Contained in file CancelIssues.xlsx.

These issues form the basis of the discussion in section 5, "Root Causes of Cancel-Related Bugs" and summaries of the data correspond to Tables 2,4,5 and 6 of the submitted paper.

3. Queries for cancel anti-pattern detection

Located in codeql-queries/ directory. These queries are used to detect anti-patterns in studied applications (described in section 7 of the paper, "Task Cancel Anti-Patterns"). The results from running the queries are populated in table 7.

Overview: using CodeQL

CodeQL is the static-analysis tool we used to detect instances of antipatterns in the applications we studied.

The tool works by generating a database of structured source code information (such as AST, data flow, and control flow information) from source code files. Users can then issue custom queries on this database. (CodeQL intro)

Queries can be issued via command line on manually built databases, or users can also use an online interface (called LGTM) which queries pre-built application databases.

We favor the browser interface to run queries, for ease-of-use and performance reasons. In one case where a pre-built database is not available (SOLR application) we require use of the command line.

Directions to reproduce results

The online tool uses pre-built databases, which will change as the app or CodeQL version gets updated. Since the latest version is different from our submitted version (only querying the latest is possible) we include expected results for latest versions of all apps in the file AntiPatternsUpdated.xlsx.

Reproduction via online tool (all apps excluding SOLR)

We provide the queries from the paper in the codeql-queries/ directory of this repo.

As a shortcut to reproduce results, we have included links to our previous query runs here. To re-run a query at a link provided, the user can trigger a "dummy" recompilation (by entering a new line at the end of the query) and then clicking the "Run" button.

img

img

Antipattern 1 - Unhandled IE in loop (Java): query

Antipattern 2 - API misuse (Java): query

Antipattern 3 - Uncanceled child tasks (Java): query

Antipattern 4 - Ignored tokens (C#): query

Antipattern 4b - Ignored tokens (CodeRush simulated resul, C#t): query

Antipattern 5 - Tokens not passed (C#): query

The number of antipatterns found for each app are clearly marked, and should match "latest" in AntiPatternsUnpdated.xlsx

Reproduction via command line (SOLR only)

The online tool does not have a pre-built database for SOLR, so the app must be queried using the command line.

We have packaged the command line tool and scripts into a docker container (requires docker installed locally: see here)

To run:

docker run -it --rm whoisutsav/codeql-solr
cd /usr/local/repro-scripts
./repro_solr_results.sh

The query results will print to the screen, and the number of rows should match "latest" in AntiPatternsUnpdated.xlsx

Issuing a query against a different app

The queries we provided can be used against different apps.

If a popular open source application

LGTM integrates with github, so many popular open-source applications will be automatically queryable.

  1. Navigate to http://lgtm.com

  2. Click the search icon at the top of the page and search for your project (searching here for "apache maven"). Click "view project"

img

  1. On the project page, click "Query this project"

img

  1. Copy and paste the query from the relevant file into the console. After the query compiles click "Run"

img

If a new application

If querying a new application, you can use the command line tool.

  1. Install the command line tool: Getting started with CodeQL CLI

  2. Build the CodeQL database: Creating CodeQL databases

  3. Query the database (can provide a query file from the repo as an argument): CodeQL query run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages