A testcase generation tool for Persistent Memory Programs.

Overview

PMFuzz

PMFuzz

PMFuzz is a testcase generation tool to generate high-value tests cases for PM testing tools (XFDetector, PMDebugger, PMTest and Pmemcheck)

If you find PMFuzz useful in your research, please cite:

Sihang Liu, Suyash Mahar, Baishakhi Ray, and Samira Khan
PMFuzz: Test Case Generation for Persistent Memory Programs
The International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2021

BibTex

@inproceedings{liu2021pmfuzz,
  title={PMFuzz: Test Case Generation for Persistent Memory Programs},
  author={Liu, Sihang and Mahar, Suyash and Ray, Baishakhi and Khan, Samira},
  booktitle={Proceedings of the Twenty-sixth International Conference on Architectural Support for Programming Languages and Operating Systems},
  year={2021}
}

Dependencies

PMFuzz was tested using the following environment configuration, other versions may work:

  1. Ubuntu 18.04
  2. NDCTL v64 or higher
  3. libunwind (libunwind-dev)
  4. libini-config (libini-config-dev)
  5. Python 3.8
  6. GNUMake >= 3.82
  7. Kernel version 5.4
  8. Anaconda or virtualenv (recommended)

For compiling documentation:

  1. doxygen
  2. pdflatex
  3. doxypypy

Compiling PMFuzz

Build PMFuzz and AFL

make -j $(nproc --all)

Install PMFuzz

sudo make install

Now, pmfuzz-fuzz should be available as an executable:

pmfuzz-fuzz --help

The following man pages are also installed:

man 1 pmfuzz-fuzz
man 7 libpmfuzz
man 7 libfakepmfuzz

To uninstall PMFuzz, run the following command:

sudo make uninstall

Compiling PMFuzz Docker image

PMFuzz also comes with a docker file to automatically configure and install pmfuzz. To build the image, run the following command from the root of the repository:

docker build -t pmfuzz-v0.9 .

The raw dockerfile is also available here: /Dockerfile.

Using PMFuzz

After installing PMFuzz, use annotations by including the PMFuzz header file:

#include "pmfuzz/pmfuzz.h"

int main() {
	printf("PMFuzz version: %s\n", pmfuzz_version_str);
}

The program would then have to be linked with either libpmfuzz or libfakepmfuzz. e.g.,

example: example.o
	$(CXX) -o $@ $< -lfakepmfuzz # or -lpmfuzz

To compile a program linked with libpmfuzz, you'd need to use PMFuzz's AFL++ version of gcc/clang. Check build/bin after building PMFuzz.

For debugging, libfakepmfuzz exports the same interface but no actual tracking mechanism, allowing it to compile with any C/C++ compiler.

An example program is available in src/example. The original ASPLOS 2021 artifact is available at https://github.com/Systems-ShiftLab/pmfuzz_asplos21_ae.

libpmfuzz API is available at docs/libpmfuzz.7.md

Compiling Documentation

Run make docs from the root, and all the documentation will be linked in the docs/ directory.

Some man pages are available as markdown formatted files:

  1. docs/libpmfuzz.7.md
  2. docs/pmfuzz-fuzz.1.md

Running custom configuration

PMFuzz uses a YML based configuration to set different parameters for fuzzing, to write a custom configuration, please follow one of the existing examples in src/pmfuzz/configs/examples/ directory.

More information on PMFuzz's syntax is here.

Modifying PMFuzz

PMFuzz was written in a modular way allowing part of PMFuzz's components to be swapped with something that has the same interface. If you have a question please open a new issue or a discussion.

Other useful information

Env variables

NOTE: If a variable doesn't have a possible value next to it, that variable would be enabled by setting it to any non-empty value (including 0).

  1. USE_FAKE_MMAP=(0,1): Enables fake mmap which mounts an image in the volaile memory.
  2. PMEM_MMAP_HINT=<addr>: Address of the mount point of the pool.
  3. ENABLE_CNST_IMG=(0,1): Disables default PMDK's behaviour that generates non-identical images for same input.
  4. FI_MODE=(<empty or unset>|IMG_GEN|IMG_REP): See libpmfuzz.c
  5. FAILURE_LIST=<path-to-output-file>: See libpmfuzz.c
  6. PMFUZZ_DEBUG=(0,1): Enables debug output from libpmfuzz
  7. ENABLE_PM_PATH: Enables deep paths in PMFuzz
  8. GEN_ALL_CS: Partially disables the probabilistic generation of crash sites and more of them are generated from libpmfuzz.c
  9. IMG_CREAT_FINJ: Disables the probabilistic generation of crash sites and all of them are generated from libpmfuzz.c
  10. PMFUZZ_SKIP_TC_CHECK: Disable testcase size check in AFL++
  11. PRIMITIVE_BASELINE_MODE: Makes workload delete image on start if the pool exists

Adding git hook for development

Following command adds a pre-commit hook to check if the tests pass:

git config --local core.hooksPath .githooks/

Reasons for Common errors

1. FileNotFoundError for instance's pid file

Raised when AFL cannot bind to a free core or no core is free.

2. Random tar command failed

Check if no free disk space is left on the device

3. shmget (2): No space left on device

Run:

ipcrm -a

Warning: This removes all user owned shared memory segments, don't run with superuser privilege or on a machine with other critical applications running.

Licensing

PMFuzz is licensed under BSD-3-clause except noted otherwise.

PMFuzz uses of the following open-source software:

  1. Preeny (license)
    Preeny was modified to fix a bug in desock. All changes are contained in vendor/pathes/preeny_path
  2. AFL++ (license)
    AFL++ was modified to include support for persistent memory tracking for PMFuzz.
Owner
Systems Research at ShiftLab
Systems Research at ShiftLab
Acute ischemic stroke dataset

AISD Acute ischemic stroke dataset contains 397 Non-Contrast-enhanced CT (NCCT) scans of acute ischemic stroke with the interval from symptom onset to

Kongming Liang 21 Sep 06, 2022
This code reproduces the results of the paper, "Measuring Data Leakage in Machine-Learning Models with Fisher Information"

Fisher Information Loss This repository contains code that can be used to reproduce the experimental results presented in the paper: Awni Hannun, Chua

Facebook Research 43 Dec 30, 2022
FairFuzz: AFL extension targeting rare branches

FairFuzz An AFL extension to increase code coverage by targeting rare branches. FairFuzz has a particular advantage on programs with highly nested str

Caroline Lemieux 222 Nov 16, 2022
Implementation of CVPR 2020 Dual Super-Resolution Learning for Semantic Segmentation

Dual super-resolution learning for semantic segmentation 2021-01-02 Subpixel Update Happy new year! The 2020-12-29 update of SISR with subpixel conv p

Sam 79 Nov 24, 2022
Meta Language-Specific Layers in Multilingual Language Models

Meta Language-Specific Layers in Multilingual Language Models This repo contains the source codes for our paper On Negative Interference in Multilingu

Zirui Wang 20 Feb 13, 2022
Code base for "On-the-Fly Test-time Adaptation for Medical Image Segmentation"

On-the-Fly Adaptation Official Pytorch Code base for On-the-Fly Test-time Adaptation for Medical Image Segmentation Paper Introduction One major probl

Jeya Maria Jose 17 Nov 10, 2022
Ground truth data for the Optical Character Recognition of Historical Classical Commentaries.

OCR Ground Truth for Historical Commentaries The dataset OCR ground truth for historical commentaries (GT4HistComment) was created from the public dom

Ajax Multi-Commentary 3 Sep 08, 2022
Human head pose estimation using Keras over TensorFlow.

RealHePoNet: a robust single-stage ConvNet for head pose estimation in the wild.

Rafael Berral Soler 71 Jan 05, 2023
A new GCN model for Point Cloud Analyse

Pytorch Implementation of PointNet and PointNet++ This repo is implementation for VA-GCN in pytorch. Classification (ModelNet10/40) Data Preparation D

12 Feb 02, 2022
[NeurIPS 2021] Source code for the paper "Qu-ANTI-zation: Exploiting Neural Network Quantization for Achieving Adversarial Outcomes"

Qu-ANTI-zation This repository contains the code for reproducing the results of our paper: Qu-ANTI-zation: Exploiting Quantization Artifacts for Achie

Secure AI Systems Lab 8 Mar 26, 2022
[RSS 2021] An End-to-End Differentiable Framework for Contact-Aware Robot Design

DiffHand This repository contains the implementation for the paper An End-to-End Differentiable Framework for Contact-Aware Robot Design (RSS 2021). I

Jie Xu 60 Jan 04, 2023
Fast EMD for Python: a wrapper for Pele and Werman's C++ implementation of the Earth Mover's Distance metric

PyEMD: Fast EMD for Python PyEMD is a Python wrapper for Ofir Pele and Michael Werman's implementation of the Earth Mover's Distance that allows it to

William Mayner 433 Dec 31, 2022
Code for Efficient Visual Pretraining with Contrastive Detection

Code for DetCon This repository contains code for the ICCV 2021 paper "Efficient Visual Pretraining with Contrastive Detection" by Olivier J. Hénaff,

DeepMind 56 Nov 13, 2022
Improving Factual Consistency of Abstractive Text Summarization

Improving Factual Consistency of Abstractive Text Summarization We provide the code for the papers: "Entity-level Factual Consistency of Abstractive T

61 Nov 27, 2022
Code for the paper "VisualBERT: A Simple and Performant Baseline for Vision and Language"

This repository contains code for the following two papers: VisualBERT: A Simple and Performant Baseline for Vision and Language (arxiv) with a short

Natural Language Processing @UCLA 463 Dec 09, 2022
Real-Time-Student-Attendence-System - Real Time Student Attendence System

Real-Time-Student-Attendence-System The Student Attendance Management System Pro

Rounak Das 1 Feb 15, 2022
The repo contains the code to train and evaluate a system which extracts relations and explanations from dialogue.

The repo contains the code to train and evaluate a system which extracts relations and explanations from dialogue. How do I cite D-REX? For now, cite

Alon Albalak 6 Mar 31, 2022
Code for the paper "Generative design of breakwaters usign deep convolutional neural network as a surrogate model"

Generative design of breakwaters usign deep convolutional neural network as a surrogate model This repository contains the code for the paper "Generat

2 Apr 10, 2022
TargetAllDomainObjects - A python wrapper to run a command on against all users/computers/DCs of a Windows Domain

TargetAllDomainObjects A python wrapper to run a command on against all users/co

Podalirius 19 Dec 13, 2022
Numba-accelerated Pythonic implementation of MPDATA with examples in Python, Julia and Matlab

PyMPDATA PyMPDATA is a high-performance Numba-accelerated Pythonic implementation of the MPDATA algorithm of Smolarkiewicz et al. used in geophysical

Atmospheric Cloud Simulation Group @ Jagiellonian University 15 Nov 23, 2022