{"action":"created","issue":{"url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz/issues/137","repository_url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz","labels_url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz/issues/137/comments","events_url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz/issues/137/events","html_url":"https://github.com/rust-fuzz/cargo-fuzz/issues/137","id":278749225,"number":137,"title":"Confusing error message when altering the type of \"data\"","user":{"login":"a2aaron","id":15718048,"avatar_url":"https://avatars1.githubusercontent.com/u/15718048?v=4","gravatar_id":"","url":"https://api.github.com/users/a2aaron","html_url":"https://github.com/a2aaron","followers_url":"https://api.github.com/users/a2aaron/followers","following_url":"https://api.github.com/users/a2aaron/following{/other_user}","gists_url":"https://api.github.com/users/a2aaron/gists{/gist_id}","starred_url":"https://api.github.com/users/a2aaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a2aaron/subscriptions","organizations_url":"https://api.github.com/users/a2aaron/orgs","repos_url":"https://api.github.com/users/a2aaron/repos","events_url":"https://api.github.com/users/a2aaron/events{/privacy}","received_events_url":"https://api.github.com/users/a2aaron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-03T06:28:00Z","updated_at":"2017-12-03T07:28:11Z","closed_at":null,"author_association":"NONE","body":"When using writing a fuzz target, one can change the signature of `data` from `&[u8]` to something else, which does not work, but prints a confusing error message.\r\nExample:\r\n```\r\nfuzz_target!(|data: &[usize]| {\r\n    // stuff\r\n}\r\n```\r\n\r\nIn all cases, the error message printed is \r\n```\r\nerror[E0463]: can't find crate for `arbitrary`\r\n --> fuzz/fuzz_targets/fuzz_target_1.rs:5:1\r\n  |\r\n5 | / fuzz_target!(|data: &[u16]| {\r\n6 | |     // stuff\r\n7 | | });\r\n  | |___^ can't find crate\r\n  |\r\n  = note: this error originates in a macro outside of the current crate (run with -Z external-macro-backtrace for more info)\r\n```\r\n\r\nThis seems rather confusing, as it isn't clear that the change to the type is the reason for the missing crate.\r\n\r\nNote that I am on `cargo 0.24.0-nightly (abd137ad1 2017-11-12)` and using `cargo-fuzz 0.5.0` on Mac OS X."},"comment":{"url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz/issues/comments/348745953","html_url":"https://github.com/rust-fuzz/cargo-fuzz/issues/137#issuecomment-348745953","issue_url":"https://api.github.com/repos/rust-fuzz/cargo-fuzz/issues/137","id":348745953,"user":{"login":"nagisa","id":679122,"avatar_url":"https://avatars1.githubusercontent.com/u/679122?v=4","gravatar_id":"","url":"https://api.github.com/users/nagisa","html_url":"https://github.com/nagisa","followers_url":"https://api.github.com/users/nagisa/followers","following_url":"https://api.github.com/users/nagisa/following{/other_user}","gists_url":"https://api.github.com/users/nagisa/gists{/gist_id}","starred_url":"https://api.github.com/users/nagisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagisa/subscriptions","organizations_url":"https://api.github.com/users/nagisa/orgs","repos_url":"https://api.github.com/users/nagisa/repos","events_url":"https://api.github.com/users/nagisa/events{/privacy}","received_events_url":"https://api.github.com/users/nagisa/received_events","type":"User","site_admin":false},"created_at":"2017-12-03T07:28:11Z","updated_at":"2017-12-03T07:28:11Z","author_association":"CONTRIBUTOR","body":"Sorry this error is confusing, but it says exactly what the problem is. It is necessary to specify the dependency on `arbitrary` crate in your `Cargo.toml` to use arguments other than `&[u8]`. An example fuzz target using the `arbitrary` support is available [here](https://github.com/rust-fuzz/libfuzzer-sys/tree/master/example_arbitrary). The list of types supported by arbitrary can be seen in the \"Implementors\" list [here](https://docs.rs/arbitrary/0.1.0/arbitrary/trait.Arbitrary.html).\r\n\r\nThat being said, be aware that using arbitrary types can make program flow more opaque to the fuzzer and thus fuzzing take longer than if you converted the data yourself in a more naive way."}}
{"actor":{"display_login":"nagisa"}}