Skip to content

[Feature]: Stochastic Fuzz Testing Engine for Memory Edge-Case Validation #674

Description

@CodeSparks45

Problem Description

With the recent additions of complex data structures (Fenwick Trees, Suffix Arrays, Advanced Heaps), relying solely on fixed unit tests might miss rare edge-case segmentation faults or use-after-free errors. We need a way to subject these structures to chaotic, randomized operations to truly validate their memory safety under Valgrind/ASan.

Proposed Solution

Build a lightweight Fuzz Testing module (fuzzer.c).

  1. Create a function that generates a massive sequence (e.g., 100,000 operations) of randomized insertions, deletions, and lookups using rand().
  2. Apply this stress test to complex structures (like Red-Black Trees or Graphs).
  3. The engine should track the operations and, if a segfault occurs, print the exact seed and sequence of operations that caused the crash for easy debugging.
  4. Hook this fuzzer into the make test pipeline so CI can catch unstable operations.

Additional Context

Suggested Labels: new feature, Hard, SSoC26


Note for Maintainers: I have cleared my previous pending assignments and my queue is empty. I am well aware of the project's strict formatting and memory safety standards. If assigned, I guarantee that I will run make fmt, make test, and make valgrind to ensure zero memory leaks and proper clang-formatting before raising the PR. Could you please assign this to me?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions