-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WARNING: no interesting inputs were found so far. Is the code instrumented for coverage? #406
Comments
Hi @Changochen, thanks for being patient. I just managed to look into the issue at hand here. This was my // fuzz.js
const { fileTypeFromBuffer } = require("file-type");
/**
* @param { Buffer } data
*/
module.exports.fuzz = function(data) {
const fuzzData = data.toString();
return fileTypeFromBuffer(Buffer.from(fuzzData));
}; This is the {
"name": "ftype-fuzz",
"version": "1.0.0",
"description": "",
"main": "fuzz.js",
"dependencies": {
"file-type": "^18.3.0"
},
"scripts": {
"fuzz": "jazzer fuzz -i ftype",
},
"devDependencies": {
"@jazzer.js/core": "file:../../packages/core"
}
}
Running it: $ npm i && npm run fuzz
(node:41056) Warning: Accessing non-existent property 'default' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
jazzer.js/examples/ftype/node_modules/append-transform/index.js:64
hook(module, filename);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module jazzer.js/examples/ftype/node_modules/file-type/index.js from jazzer.js/examples/ftype/fuzz.js not supported.
Instead change the require of index.js in jazzer.js/examples/ftype/fuzz.js to a dynamic import() which is available in all CommonJS modul
s.
at Object.<anonymous> (jazzer.js/examples/ftype/node_modules/append-transform/index.js:64:4)
at Object.<anonymous> (jazzer.js/examples/ftype/fuzz.js:8:5)
at Module._compile (jazzer.js/examples/ftype/node_modules/source-map-support/source-map-support.js:568:25)
at Module.replacementCompile (jazzer.js/examples/ftype/node_modules/append-transform/index.js:60:13)
at Object.<anonymous> (jazzer.js/examples/ftype/node_modules/append-transform/index.js:64:4) This showcases the problem, that didn't occur in your case, by writing your fuzz case in ES6 syntax. The npmjs page confirms, that: This package is a ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). Checking the repository also shows that this is a pure ESM module, which we currently don't support (compare: #162, #239). It's on our roadmap to get full ESM support in the foreseeable future! Until then, I recommend writing fuzz tests in CommonJS as it can uncover such an issue at a faster pace. PS: PR's with better ESM support are welcome ;D |
I see. Thanks for the investigation and the information!
|
Thanks for creating such an awesome tool!
I have the problem trying to fuzz
file-type
as a test for fuzzing async function.My harness
FuzzTarget.js
:package.json
:Running and the result is:
I tried to write
Which doesn't work.
So I wonder why there is no coverage found. If the code is instrumented, it should not find no interesting inputs.
Thanks!
The text was updated successfully, but these errors were encountered: