Skip to content
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

Coverage does not increase #427

Closed
ahpaleus opened this issue May 2, 2023 · 3 comments
Closed

Coverage does not increase #427

ahpaleus opened this issue May 2, 2023 · 3 comments

Comments

@ahpaleus
Copy link

ahpaleus commented May 2, 2023

Hey,
Why coverage does not increase where I fuzz a particular function from a node package? How to solve this problem?

Let's say:

const parseHTML = require('node-html-parser')

module.exports.fuzz = function (data) {
    const fuzzerData = data.toString();
    let root = parseHTML.parse(fuzzerData)
}

output:

$ npx jazzer fuzz
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 319397578
INFO: Loaded 1 modules   (512 inline 8-bit counters): 512 [0x7fd2a8040000, 0x7fd2a8040200), 
INFO: Loaded 1 PC tables (512 PCs): 512 [0x7fd242700000,0x7fd242702000), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2      INITED cov: 1 ft: 1 corp: 1/1b exec/s: 0 rss: 117Mb
#32768  pulse  cov: 1 ft: 1 corp: 1/1b lim: 325 exec/s: 16384 rss: 140Mb
#65536  pulse  cov: 1 ft: 1 corp: 1/1b lim: 652 exec/s: 16384 rss: 140Mb
#131072 pulse  cov: 1 ft: 1 corp: 1/1b lim: 1300 exec/s: 16384 rss: 141Mb
#262144 pulse  cov: 1 ft: 1 corp: 1/1b lim: 2611 exec/s: 17476 rss: 141Mb
#524288 pulse  cov: 1 ft: 1 corp: 1/1b lim: 4096 exec/s: 18078 rss: 141Mb
@oetr
Copy link
Contributor

oetr commented May 2, 2023

Maybe you didn't instrument the node-html-parser?
I tried with this in my package.json, and it works:

"scripts": {
    "fuzz": "jazzer fuzz -i node-html-parser --sync"
}

Or using npx: npx run fuzz -i node-html-parser

@0xricksanchez
Copy link
Contributor

Hi,

just tested this and it works fine for me when running npm run fuzz instead of npx run fuzz

@ahpaleus
Copy link
Author

ahpaleus commented May 2, 2023

Exactly! I missed the -i argument, thanks!

@ahpaleus ahpaleus closed this as completed May 2, 2023
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

No branches or pull requests

3 participants