tessl install tessl/pypi-atheris@2.3.0A coverage-guided fuzzer for Python and Python extensions based on libFuzzer
Agent Success
Agent success rate when using this tile
91%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.28x
Baseline
Agent success rate without this tile
71%
Build a program that demonstrates proper counter management when dynamically instrumenting Python code for fuzzing.
Create a Python script dynamic_counter_manager.py that implements the following:
Counter Reservation: Reserve coverage counter IDs using the fuzzing library's counter reservation mechanism.
Dynamic Code Instrumentation: Create a simple Python function at runtime and apply instrumentation to enable coverage tracking.
Counter Registration: After reserving counters and instrumenting code, register the counters with the fuzzing engine to enable coverage tracking.
Verification Output: Print information showing:
File: dynamic_counter_manager.test.py
# Test that multiple counter registration calls work correctly
def test_sequential_registration():
"""Verify that counters can be registered multiple times as new counters are allocated."""
import dynamic_counter_manager
# The script should reserve at least 2 counters
# and call the registration function at least twice
# Check that output shows increasing counter IDs
output = dynamic_counter_manager.main()
assert "Counter" in output or "counter" in output
assert "registered" in output.lower() or "registration" in output.lower()
print("PASS: Sequential registration test")File: dynamic_counter_manager.test.py
# Test that instrumented code is properly marked
def test_instrumentation_marker():
"""Verify that dynamically instrumented code contains the instrumentation marker."""
import dynamic_counter_manager
# The script should verify and output that code was instrumented
output = dynamic_counter_manager.main()
assert "instrumented" in output.lower() or "marker" in output.lower()
print("PASS: Instrumentation marker test")Provides coverage-guided fuzzing capabilities for Python code, including dynamic instrumentation and counter management.
main() function that returns a string with status informationThe program should output text showing:
Example output format:
Reserved counter ID: 0
Reserved counter ID: 1
Counters registered successfully
Instrumentation marker found: True