Crash on a single malloc that exceeds the rss limit.
| 126 | |
| 127 | // Crash on a single malloc that exceeds the rss limit. |
| 128 | void Fuzzer::HandleMalloc(size_t Size) { |
| 129 | if (!Options.MallocLimitMb || (Size >> 20) < (size_t)Options.MallocLimitMb) |
| 130 | return; |
| 131 | Printf("==%d== ERROR: libFuzzer: out-of-memory (malloc(%zd))\n", GetPid(), |
| 132 | Size); |
| 133 | Printf(" To change the out-of-memory limit use -rss_limit_mb=<N>\n\n"); |
| 134 | PrintStackTrace(); |
| 135 | DumpCurrentUnit("oom-"); |
| 136 | Printf("SUMMARY: libFuzzer: out-of-memory\n"); |
| 137 | PrintFinalStats(); |
| 138 | _Exit(Options.OOMExitCode); // Stop right now. |
| 139 | } |
| 140 | |
| 141 | Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD, |
| 142 | const FuzzingOptions &Options) |
no test coverage detected