rust-fuzz / rust-fuzz/arbitrary

#![no_std] Support

Open
#38 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
880
Forks
93
PR merge metrics
No merged PRs in 30d

Description

The Arbitrary crate isn't #[no_std], which prevent fuzzing #![no_std] crates. For now can be worked around by using #![cfg_attr(not(feature = "fuzzing), no_std)] at the top of the fuzzed crate instead of #![no_std], but it would be better not to need this workaround.

Although I don't really see a use case of doing the actual fuzzing in a #![no_std] environment, is would be nice not to need any reference to std in the fuzzed crate.

AFAIK, the arbitrary crate doesn't really rely on std features and pretty much everything required can be fetched from the alloc create.

I forked the crate and started to try to make the change. The first roadbump I encountered is the quote crate used in arbitrary-derive, so I might need to open a simillar issue over there.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the Arbitrary crate's use of std and the arbitrary-derive dependency on quote. Check whether the required functionality can use alloc instead, and verify that a no_std fuzzed crate no longer needs the cfg_attr workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.