| 78 | } |
| 79 | |
| 80 | void TracePC::PrintModuleInfo() { |
| 81 | if (NumModules) { |
| 82 | Printf("INFO: Loaded %zd modules (%zd inline 8-bit counters): ", |
| 83 | NumModules, NumInline8bitCounters); |
| 84 | for (size_t i = 0; i < NumModules; i++) |
| 85 | Printf("%zd [%p, %p), ", Modules[i].Size(), Modules[i].Start(), |
| 86 | Modules[i].Stop()); |
| 87 | Printf("\n"); |
| 88 | } |
| 89 | if (NumPCTables) { |
| 90 | Printf("INFO: Loaded %zd PC tables (%zd PCs): ", NumPCTables, |
| 91 | NumPCsInPCTables); |
| 92 | for (size_t i = 0; i < NumPCTables; i++) { |
| 93 | Printf("%zd [%p,%p), ", ModulePCTable[i].Stop - ModulePCTable[i].Start, |
| 94 | ModulePCTable[i].Start, ModulePCTable[i].Stop); |
| 95 | } |
| 96 | Printf("\n"); |
| 97 | |
| 98 | if (NumInline8bitCounters && NumInline8bitCounters != NumPCsInPCTables) { |
| 99 | Printf("ERROR: The size of coverage PC tables does not match the\n" |
| 100 | "number of instrumented PCs. This might be a compiler bug,\n" |
| 101 | "please contact the libFuzzer developers.\n" |
| 102 | "Also check https://bugs.llvm.org/show_bug.cgi?id=34636\n" |
| 103 | "for possible workarounds (tl;dr: don't use the old GNU ld)\n"); |
| 104 | _Exit(1); |
| 105 | } |
| 106 | } |
| 107 | if (size_t NumExtraCounters = ExtraCountersEnd() - ExtraCountersBegin()) |
| 108 | Printf("INFO: %zd Extra Counters\n", NumExtraCounters); |
| 109 | |
| 110 | size_t MaxFeatures = CollectFeatures([](uint32_t) {}); |
| 111 | if (MaxFeatures > std::numeric_limits<uint32_t>::max()) |
| 112 | Printf("WARNING: The coverage PC tables may produce up to %zu features.\n" |
| 113 | "This exceeds the maximum 32-bit value. Some features may be\n" |
| 114 | "ignored, and fuzzing may become less precise. If possible,\n" |
| 115 | "consider refactoring the fuzzer into several smaller fuzzers\n" |
| 116 | "linked against only a portion of the current target.\n", |
| 117 | MaxFeatures); |
| 118 | } |
| 119 | |
| 120 | ATTRIBUTE_NO_SANITIZE_ALL |
| 121 | void TracePC::HandleCallerCallee(uintptr_t Caller, uintptr_t Callee) { |
no test coverage detected