Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add fuzzer for collections module#40

Open
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-collections-fuzzer
Open

Add fuzzer for collections module#40
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-collections-fuzzer

Conversation

@AdamKorcz
Copy link
Copy Markdown
Contributor

@AdamKorcz AdamKorcz commented Apr 10, 2026

Fuzzes the CPython _collections C module (Modules/_collectionsmodule.c) plus the OrderedDict C implementation (Objects/odictobject.c). Dispatches per input across four targets: _count_elements() over a fuzzed latin-1 string; collections.deque with an optional maxlen running up to 30 mixed operations (append/appendleft, pop/popleft, extend/extendleft, rotate, reverse, count/index/remove with random-typed values to reach error paths, clear, copy, rich comparison against a second deque, and list/len/bool iteration); defaultdict(int) driven through increment/access/contains/pop on reused short keys to hit both __missing__ and hit paths; and OrderedDict exercised via set, pop, move_to_end, popitem, key listing, and reversed iteration — with fuzzed last= flags to drive the internal linked-list reordering logic.

@AdamKorcz AdamKorcz requested a review from a team as a code owner April 10, 2026 19:55
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 20:59
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 20:59
@AdamKorcz AdamKorcz force-pushed the add-collections-fuzzer branch from c1f9892 to 96e3c79 Compare April 11, 2026 21:00
@AdamKorcz AdamKorcz force-pushed the add-collections-fuzzer branch from 96e3c79 to f69e624 Compare April 22, 2026 20:32
@AdamKorcz AdamKorcz marked this pull request as ready for review April 22, 2026 20:35
Fuzzes the CPython _collections C module (Modules/_collectionsmodule.c)
plus the OrderedDict C implementation (Objects/odictobject.c). Dispatches
per input across four targets: _count_elements() over a fuzzed latin-1
string; collections.deque with an optional maxlen running up to 30 mixed
operations (append/appendleft, pop/popleft, extend/extendleft, rotate,
reverse, count/index/remove with random-typed values to reach error
paths, clear, copy, rich comparison against a second deque, and
list/len/bool iteration); defaultdict(int) driven through
increment/access/contains/pop on reused short keys to hit both
__missing__ and hit paths; and OrderedDict exercised via set, pop,
move_to_end, popitem, key listing, and reversed iteration — with
fuzzed last= flags to drive the internal linked-list reordering logic.
@AdamKorcz AdamKorcz force-pushed the add-collections-fuzzer branch from f69e624 to b0a808f Compare April 22, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant