Registry / testing / abi3audit

abi3audit

JSON →
library0.0.26pypypi✓ verified 82d ago

abi3audit is a command-line tool developed by Trail of Bits and now maintained by the Python Packaging Authority (PyPA). It scans Python wheels and shared objects for Application Binary Interface (ABI) violations and inconsistencies. Its purpose is to ensure that CPython extensions tagged as `abi3` actually comply with the stable ABI, thereby preventing potential crashes or memory corruption due to ABI mismatches. The library is currently at version 0.0.26 and receives frequent, minor releases, indicating active development.

pip install abi3audit
INSTALL
IMPORT
SIG · ABI3AUDIT
A
abi3audit
testingpythonv0.0.26
Install
4.1s avg
Import
14ms
Disk
38MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.26 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.015s · 39.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.1s · import 0.014s · 40MB
38MB installed
● package 38MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

abi3audit
import abi3audit
import subprocess

This quickstart demonstrates how to programmatically audit a PyPI package for ABI3 compliance using `abi3audit` via a subprocess call. The example audits 'numpy' and uses the `--verbose` flag for detailed output. It handles potential errors like `abi3audit` not being found or an audit failing.

import subprocess # Audit a specific PyPI package for ABI3 compliance # Replace 'numpy' with the actual package name you wish to audit. # The '--verbose' flag provides detailed output. package_to_audit = 'numpy' try: print(f"Auditing {package_to_audit} for ABI3 compliance...") result = subprocess.run( ['abi3audit', package_to_audit, '--verbose'], capture_output=True, text=True, check=True ) print("\nAudit Successful:\n") print(result.stdout) except subprocess.CalledProcessError as e: print(f"\nAudit Failed for {package_to_audit}:\n") print(f"Stderr: {e.stderr}") print(f"Stdout: {e.stdout}") except FileNotFoundError: print("Error: 'abi3audit' command not found. Is it installed and in your PATH?")
abi3audit --version
Debug
Known issues
breakingStarting with version 0.0.26, abi3audit officially drops support for Python 3.9. Ensure your environment uses Python 3.10 or newer.
fix
Upgrade your Python environment to 3.10 or a later supported version (e.g., Python 3.11, 3.12, 3.13, 3.14). If Python 3.9 is required, you must use an older version of abi3audit, such as 0.0.25, and pin its version accordingly.
affects: >=0.0.26
gotchaThe support for Python 3.9 has fluctuated. It was re-added in v0.0.25 but then dropped again in v0.0.26. This can lead to unexpected compatibility issues if you rely on specific minor versions.
fix
Always check the `requires_python` metadata and the release notes for abi3audit. For stability, explicitly pin the abi3audit version in your project (e.g., `abi3audit==0.0.25`) if you depend on a specific Python version that has had fluctuating support.
affects: 0.0.25, 0.0.26
gotchaWhen auditing bare `.abi3.so` shared objects, abi3audit cannot infer the intended minimum ABI3 version and defaults to the lowest known version (abi3-cp32). This might result in false positives for symbols stabilized in later Python versions.
fix
Whenever possible, audit entire wheels or PyPI packages (e.g., `abi3audit my_package.whl` or `abi3audit my-package`) rather than individual shared objects, as wheels contain the necessary metadata for accurate analysis.
affects: All
gotchaabi3audit is a best-effort tool and cannot detect dynamic ABI3 violations (e.g., C extensions calling `dlsym(3)` to invoke non-abi3 functions at runtime).
fix
Be aware of this limitation and combine `abi3audit` with other dynamic analysis tools if your C extensions utilize dynamic symbol loading.
affects: All
breakingPython 3.8 support was removed in version 0.0.18.
fix
Upgrade your Python environment to 3.9 or newer, or use an older version of abi3audit if Python 3.8 support is critical.
affects: >=0.0.18
Upgrade
Version history
0.0.26latest on PyPI · released Jan 23, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
56 hits · last 30 days
node
48
OpenAI (training)
1
Resources
abi3audit — pip install abi3audit · libregistry