use hitcounts in libfuzzer rt
This commit is contained in:
parent
dc39a5591a
commit
7c9fc88e66
@ -95,6 +95,7 @@ fn main() {
|
||||
cc::Build::new()
|
||||
.include(&libpng_path)
|
||||
.flag("-fsanitize-coverage=trace-pc-guard")
|
||||
// .define("HAS_DUMMY_CRASH", "1")
|
||||
.file("./harness.cc")
|
||||
.compile("libfuzzer-harness");
|
||||
|
||||
|
@ -20,8 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#define HAS_BUG 1
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
@ -159,8 +157,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
// This is going to be too slow.
|
||||
if (width && height > 100000000 / width) {
|
||||
PNG_CLEANUP
|
||||
if (HAS_BUG)
|
||||
asm("ud2");
|
||||
#ifdef HAS_DUMMY_CRASH
|
||||
asm("ud2");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,6 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
|
||||
|
||||
// A fuzzer with just one stage and a minimization+queue policy to get testcasess from the corpus
|
||||
let scheduler = IndexesLenTimeMinimizerCorpusScheduler::new(QueueCorpusScheduler::new());
|
||||
//let scheduler = QueueCorpusScheduler::new();
|
||||
let fuzzer = StdFuzzer::new(scheduler, tuple_list!(stage));
|
||||
|
||||
// Create the executor for an in-process function with just one observer for edge coverage
|
||||
|
@ -17,9 +17,9 @@ uint32_t __lafl_max_edges_size = 0;
|
||||
void __sanitizer_cov_trace_pc_guard(uint32_t *guard) {
|
||||
|
||||
uint32_t pos = *guard;
|
||||
//uint16_t val = __lafl_edges_map[pos] + 1;
|
||||
//__lafl_edges_map[pos] = ((uint8_t) val) + (uint8_t) (val >> 8);
|
||||
__lafl_edges_map[pos] = 1;
|
||||
uint16_t val = __lafl_edges_map[pos] + 1;
|
||||
__lafl_edges_map[pos] = ((uint8_t) val) + (uint8_t) (val >> 8);
|
||||
//__lafl_edges_map[pos] = 1;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user