Chaos Cat brings destruction and suffering to your software

Overview

Chaos Cat - Wreaking havoc to your syscalls since 2022!

Chaos Cat brings destruction and suffering to your software. When Chaos Cat is loaded it will randomly make predefined syscalls fail. This tests your software for the the things you might have forgotten to check because operating systems usually Just Work™ and syscalls usually never fail.

Chaos Cat is a dynamic library to be loaded using LD_PRELOAD (Linux) or DYLD_INSERT_LIBRARIES (macOS) and to be configured with environment variable.

The testing is as easy as:

  1. Configure your environment variables
  2. Run your program with Chaos Cat enabled
  3. ...
  4. Profit!

Enabling Chaos Cat

Set environment variable CHAOSCAT_OPTS with list of syscalls to break delimeted by colon (:). For example:

$ export CHAOSCAT_OPTS="read:write"

Supported syscalls

Syscall Return value errno
open -1 EINTR
read -1 EINTR
write -1 EINTR
socket -1 ENOBUFS
connect -1 EINTR
sendto -1 ENOBUFS

The links to syscalls point to OpenBSD's manual pages. This is because of the high quality of the documentation OpenBSD provides. The syscalls are standard (e.g. conform to IEEE Std 1003.1-2008 (“POSIX.1”)) so they should function in any POSIX conforming systems.

How syscalls indicate error?

When a system call detects an error, it returns an integer value indicating failure (usually -1) and sets the variable errno accordingly. (This allows interpretation of the failure on receiving a -1 and to take action accordingly.) Successful calls never set errno; once set, it remains until another error occurs. It should only be examined after an error. Note that a number of system calls overload the meanings of these error numbers, and that the meanings must be interpreted according to the type and circumstances of the call.

Source: https://man.openbsd.org/intro.2#DIAGNOSTICS

Running in macOS

Set environment variables:

$ export DYLD_FORCE_FLAT_NAMESPACE=1
$ export CHAOSCAT_OPTS="read:write"

And run the program to be tested:

$ DYLD_INSERT_LIBRARIES="/path/to/libchaoscat.dylib" my-awesome-binary

Running in Linux

Set environment variables:

$ export CHAOSCAT_OPTS="read:write"

And run the program to be tested:

$ LD_PRELOAD="/path/to/libchaoscat.dylib" my-awesome-binary
You might also like...
Bolik Timeline is local-first software for keeping notes and files.

Bolik monorepo Bolik Timeline is local-first software for keeping notes and files. This repo contains alpha-quality software. This means that we are e

A curated list of replacements for existing software written in Rust

Awesome Alternatives in Rust A curated list of replacements for existing software written in Rust. If you want to contribute, please read CONTRIBUTING

Metaballs (blobs) coded in Rust. 100% software rendering.
Metaballs (blobs) coded in Rust. 100% software rendering.

Metaballs (blobs) coded in Rust. 100% software rendering. It is basically a Rust version of my old demo effect from the 90s (back then we'd use a fake Phong shading, though).

UniSBOM is a tool to build a software bill of materials on any platform with a unified data format.

UniSBOM is a tool to build a software bill of materials on any platform with a unified data format. Work in progress Support MacOS Uses system_profile

Work-in-progress software for managing the Azeron keypad on any operating system.
Work-in-progress software for managing the Azeron keypad on any operating system.

azeron-cli A small, unfinished CLI application intended to manage the Azeron Cyborg. The code is still in a very messy state and doesn't look very rus

This is a multilingual word learning software.
This is a multilingual word learning software.

Ladder This is a multilingual word learning software. How to add words to the software The project contains the words.json file, json contains learn a

CUI terminal software for MSX0.
CUI terminal software for MSX0.

msxterm とは msxterm とは PC から MSX0 に TCP/IP 接続するための専用ターミナルソフトです。 CUI で主にプログラム作成に使用する事を想定しています。 BASICでプログラムを組む際に色々便利な機能を内蔵しています。 MSX0 の文字コードをフルにサポートしているの

A tiny software renderer written in Rust.
A tiny software renderer written in Rust.

tiny-renderer 简单的软光栅化渲染器 基础数学库 Bresenham画线算法 Cohen-Sutherland线段裁剪算法 glTF模型加载 模型/视图/投影变换 背面剔除 视椎剔除 齐次空间裁剪 深度测试 Blinn–Phong着色模型 重心坐标插值 运行 bresenham画线算法

nix2sbom extracts the SBOM (Software Bill of Materials) from a Nix derivation

nix2sbom nix2sbom extracts the SBOM (Software Bill of Materials) from a Nix derivation 📚 Documentation for using nix2sbom is here Warning This repo i

Owner
Ossi Herrala
I Like open source, good quality and Rust. IRC: oherrala @ IRCNet, Twitter: oherrala, Mastodon: [email protected]
Ossi Herrala
🌈 Brings back colour console to Win64 for Garry's Mod SRCDS

?? gmsv_concolormsg This module for Garry's Mod fixes x86-64 Windows 64-bit SRCDS not displaying colours. Why does it do that? Who knows! But it's eas

William 11 Oct 4, 2022
This repository brings together my studies in the Rust language.

Studying_Rust This repository brings together my studies in the Rust language. Study schedule in 90 days start date: 7/24 end date: 10/24 Each topic w

Débora Marim 5 Aug 8, 2023
A cat(1) clone with syntax highlighting and Git integration.

A cat(1) clone with syntax highlighting and Git integration. Key Features • How To Use • Installation • Customization • Project goals, alternatives [中

David Peter 38.9k Jan 8, 2023
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Renan Fernandes 2 Mar 5, 2022
Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim.

cat.nvim Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim. Failed as I realized far too late, that

James Vero 4 Aug 5, 2022
Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.

smartcat (sc) Puts a brain behind cat! CLI interface to bring language models in the Unix ecosystem and allow power users to make the most out of llms

Emilien Fugier 28 Dec 2, 2023
(Pre-Release Software) Secure, Encrypted, P2P chat written atop Warp, IPFS, LibP2P, Dioxus and many more awesome projects and protocols.

Uplink Privacy First, Modular, P2P messaging client built atop Warp. Uplink is written in pure Rust with a UI in Dioxus (which is also written in Rust

Satellite 13 Jan 25, 2023
A simple gtk4/libadwaita software center to easily install and manage nix packages

Nix Software Center A graphical app store for Nix built with libadwaita, GTK4, and Relm4. Heavily inspired by GNOME Software. Features Install package

Victor Fuentes 169 Dec 30, 2022
A server software designed for fetching Minecraft and Minecraft-related metadata

Minecraft Metadata Server A server software designed for fetching Minecraft and Minecraft-related metadata (such as Forge, Fabric, Quilt and Liteloade

Prism Launcher 11 Jan 19, 2023
A free and open-source DNA Sequencing/Visualization software for bioinformatics research.

DNArchery ?? A free and open-source cross-platform DNA Sequencing/Visualization Software for bioinformatics research. A toolkit for instantly performi

null 21 Mar 26, 2023