mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 03:18:07 +00:00
forgot cleanup
This commit is contained in:
@ -141,8 +141,7 @@ static inline void* DFL_ck_realloc(void* orig, u32 size) {
|
|||||||
|
|
||||||
static inline void* DFL_ck_realloc_block(void* orig, u32 size) {
|
static inline void* DFL_ck_realloc_block(void* orig, u32 size) {
|
||||||
|
|
||||||
if (orig)
|
if (orig) size += ALLOC_BLK_INC;
|
||||||
size += ALLOC_BLK_INC;
|
|
||||||
|
|
||||||
return DFL_ck_realloc(orig, size);
|
return DFL_ck_realloc(orig, size);
|
||||||
|
|
||||||
|
@ -498,7 +498,9 @@ int main(int argc, char** argv, char** envp) {
|
|||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
} else if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) {
|
} else if ((isatty(2) && !getenv("AFL_QUIET")) ||
|
||||||
|
|
||||||
|
getenv("AFL_DEBUG") != NULL) {
|
||||||
|
|
||||||
#ifdef USE_TRACE_PC
|
#ifdef USE_TRACE_PC
|
||||||
SAYF(cCYA "afl-clang-fast" VERSION cRST
|
SAYF(cCYA "afl-clang-fast" VERSION cRST
|
||||||
|
@ -145,8 +145,6 @@ bool AFLCoverage::runOnModule(Module &M) {
|
|||||||
|
|
||||||
char be_quiet = 0;
|
char be_quiet = 0;
|
||||||
|
|
||||||
printf("DEBUG? %s\n", getenv("AFL_DEBUG"));
|
|
||||||
|
|
||||||
if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) {
|
if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) {
|
||||||
|
|
||||||
SAYF(cCYA "afl-llvm-pass" VERSION cRST " by <lszekeres@google.com>\n");
|
SAYF(cCYA "afl-llvm-pass" VERSION cRST " by <lszekeres@google.com>\n");
|
||||||
@ -483,7 +481,6 @@ printf("DEBUG? %s\n", getenv("AFL_DEBUG"));
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
printf ("BEQUIET!\n");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -1244,12 +1244,14 @@ bool SplitComparesTransform::runOnModule(Module &M) {
|
|||||||
simplifyIntSignedness(M);
|
simplifyIntSignedness(M);
|
||||||
|
|
||||||
if (isatty(2) && getenv("AFL_QUIET") == NULL) {
|
if (isatty(2) && getenv("AFL_QUIET") == NULL) {
|
||||||
|
|
||||||
errs() << "Split-compare-pass by laf.intel@gmail.com, extended by "
|
errs() << "Split-compare-pass by laf.intel@gmail.com, extended by "
|
||||||
"heiko@hexco.de\n";
|
"heiko@hexco.de\n";
|
||||||
|
|
||||||
if (enableFPSplit)
|
if (enableFPSplit)
|
||||||
errs() << "Split-floatingpoint-compare-pass: " << splitFPCompares(M)
|
errs() << "Split-floatingpoint-compare-pass: " << splitFPCompares(M)
|
||||||
<< " FP comparisons splitted\n";
|
<< " FP comparisons splitted\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (bitw) {
|
switch (bitw) {
|
||||||
|
@ -491,7 +491,8 @@ bool SplitSwitchesTransform::splitSwitches(Module &M) {
|
|||||||
* less, don't bother with the code below. */
|
* less, don't bother with the code below. */
|
||||||
if (!SI->getNumCases() || bitw <= 8) {
|
if (!SI->getNumCases() || bitw <= 8) {
|
||||||
|
|
||||||
if (isatty(2) && getenv("AFL_QUIET") == NULL) errs() << "skip trivial switch..\n";
|
if (isatty(2) && getenv("AFL_QUIET") == NULL)
|
||||||
|
errs() << "skip trivial switch..\n";
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -603,9 +603,11 @@ void perform_dry_run(char** argv) {
|
|||||||
"binary. Also,\n"
|
"binary. Also,\n"
|
||||||
" if you are using ASAN, see %s/notes_for_asan.md.\n\n"
|
" if you are using ASAN, see %s/notes_for_asan.md.\n\n"
|
||||||
|
|
||||||
" - In QEMU persistent mode the selected address(es) for the loop are not\n"
|
" - In QEMU persistent mode the selected address(es) for the "
|
||||||
|
"loop are not\n"
|
||||||
" properly cleaning up variables and memory. Try adding\n"
|
" properly cleaning up variables and memory. Try adding\n"
|
||||||
" AFL_QEMU_PERSISTENT_GPR=1 or select better addresses in the binary.\n\n"
|
" AFL_QEMU_PERSISTENT_GPR=1 or select better addresses in "
|
||||||
|
"the binary.\n\n"
|
||||||
|
|
||||||
MSG_FORK_ON_APPLE
|
MSG_FORK_ON_APPLE
|
||||||
|
|
||||||
@ -628,9 +630,11 @@ void perform_dry_run(char** argv) {
|
|||||||
"interesting\n"
|
"interesting\n"
|
||||||
" inputs - but not ones that cause an outright crash.\n\n"
|
" inputs - but not ones that cause an outright crash.\n\n"
|
||||||
|
|
||||||
" - In QEMU persistent mode the selected address(es) for the loop are not\n"
|
" - In QEMU persistent mode the selected address(es) for the "
|
||||||
|
"loop are not\n"
|
||||||
" properly cleaning up variables and memory. Try adding\n"
|
" properly cleaning up variables and memory. Try adding\n"
|
||||||
" AFL_QEMU_PERSISTENT_GPR=1 or select better addresses in the binary.\n\n"
|
" AFL_QEMU_PERSISTENT_GPR=1 or select better addresses in "
|
||||||
|
"the binary.\n\n"
|
||||||
|
|
||||||
MSG_FORK_ON_APPLE
|
MSG_FORK_ON_APPLE
|
||||||
|
|
||||||
|
@ -113,7 +113,8 @@ static void usage(u8* argv0) {
|
|||||||
" pacemaker mode (minutes of no new paths, 0 = "
|
" pacemaker mode (minutes of no new paths, 0 = "
|
||||||
"immediately).\n"
|
"immediately).\n"
|
||||||
" a recommended value is 10-60. see docs/README.MOpt\n"
|
" a recommended value is 10-60. see docs/README.MOpt\n"
|
||||||
" -c program - enable CmpLog by specifying a binary compiled for it.\n"
|
" -c program - enable CmpLog by specifying a binary compiled for "
|
||||||
|
"it.\n"
|
||||||
" if using QEMU, just use -c 0.\n\n"
|
" if using QEMU, just use -c 0.\n\n"
|
||||||
|
|
||||||
"Fuzzing behavior settings:\n"
|
"Fuzzing behavior settings:\n"
|
||||||
@ -833,20 +834,26 @@ int main(int argc, char** argv, char** envp) {
|
|||||||
? strlen(tmp_dir) + 1 + 10 + 1 + strlen(file_extension) + 1
|
? strlen(tmp_dir) + 1 + 10 + 1 + strlen(file_extension) + 1
|
||||||
: strlen(tmp_dir) + 1 + 10 + 1];
|
: strlen(tmp_dir) + 1 + 10 + 1];
|
||||||
if (file_extension) {
|
if (file_extension) {
|
||||||
|
|
||||||
sprintf(tmpfile, "%s/.cur_input.%s", tmp_dir, file_extension);
|
sprintf(tmpfile, "%s/.cur_input.%s", tmp_dir, file_extension);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
sprintf(tmpfile, "%s/.cur_input", tmp_dir);
|
sprintf(tmpfile, "%s/.cur_input", tmp_dir);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access(tmpfile, F_OK) !=
|
if (access(tmpfile, F_OK) !=
|
||||||
-1) // there is still a race condition here, but well ...
|
-1) // there is still a race condition here, but well ...
|
||||||
FATAL("AFL_TMPDIR already has an existing temporary input file: %s - if this is not from another instance, then just remove the file.",
|
FATAL(
|
||||||
|
"AFL_TMPDIR already has an existing temporary input file: %s - if "
|
||||||
|
"this is not from another instance, then just remove the file.",
|
||||||
tmpfile);
|
tmpfile);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
tmp_dir = out_dir;
|
tmp_dir = out_dir;
|
||||||
|
|
||||||
|
|
||||||
/* If we don't have a file name chosen yet, use a safe default. */
|
/* If we don't have a file name chosen yet, use a safe default. */
|
||||||
|
|
||||||
if (!out_file) {
|
if (!out_file) {
|
||||||
@ -884,11 +891,13 @@ int main(int argc, char** argv, char** envp) {
|
|||||||
if (!out_file) setup_stdio_file();
|
if (!out_file) setup_stdio_file();
|
||||||
|
|
||||||
if (cmplog_binary) {
|
if (cmplog_binary) {
|
||||||
|
|
||||||
if (unicorn_mode)
|
if (unicorn_mode)
|
||||||
FATAL("CmpLog and Unicorn mode are not compatible at the moment, sorry");
|
FATAL("CmpLog and Unicorn mode are not compatible at the moment, sorry");
|
||||||
if (!qemu_mode)
|
if (!qemu_mode) check_binary(cmplog_binary);
|
||||||
check_binary(cmplog_binary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_binary(argv[optind]);
|
check_binary(argv[optind]);
|
||||||
|
|
||||||
start_time = get_cur_time();
|
start_time = get_cur_time();
|
||||||
|
@ -342,7 +342,7 @@ static void edit_params(u32 argc, char** argv) {
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
char *env_info =
|
char* env_info =
|
||||||
"Environment variables used by afl-gcc:\n"
|
"Environment variables used by afl-gcc:\n"
|
||||||
"AFL_CC: path to the C compiler to use\n"
|
"AFL_CC: path to the C compiler to use\n"
|
||||||
"AFL_CXX: path to the C++ compiler to use\n"
|
"AFL_CXX: path to the C++ compiler to use\n"
|
||||||
@ -365,8 +365,7 @@ int main(int argc, char** argv) {
|
|||||||
"AFL_INST_RATIO: percentage of branches to instrument\n"
|
"AFL_INST_RATIO: percentage of branches to instrument\n"
|
||||||
"AFL_QUIET: suppress verbose output\n"
|
"AFL_QUIET: suppress verbose output\n"
|
||||||
"AFL_KEEP_ASSEMBLY: leave instrumented assembly files\n"
|
"AFL_KEEP_ASSEMBLY: leave instrumented assembly files\n"
|
||||||
"AFL_AS_FORCE_INSTRUMENT: force instrumentation for asm sources\n"
|
"AFL_AS_FORCE_INSTRUMENT: force instrumentation for asm sources\n";
|
||||||
;
|
|
||||||
|
|
||||||
if (argc == 2 && strcmp(argv[1], "-h") == 0) {
|
if (argc == 2 && strcmp(argv[1], "-h") == 0) {
|
||||||
|
|
||||||
@ -410,7 +409,8 @@ int main(int argc, char** argv) {
|
|||||||
"Setting AFL_HARDEN enables hardening optimizations in the compiled "
|
"Setting AFL_HARDEN enables hardening optimizations in the compiled "
|
||||||
"code.\n\n%s"
|
"code.\n\n%s"
|
||||||
|
|
||||||
, BIN_PATH, BIN_PATH, env_info);
|
,
|
||||||
|
BIN_PATH, BIN_PATH, env_info);
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user