Skip to content

Dont clear the screen when printing stats by scrolling it #2500

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

Merged
merged 4 commits into from
Jul 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/afl-fuzz.h
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,7 @@ void write_setup_file(afl_state_t *, u32, char **);
void write_stats_file(afl_state_t *, u32, double, double, double);
void maybe_update_plot_file(afl_state_t *, u32, double, double);
void write_queue_stats(afl_state_t *);
void make_space_for_stats();
void show_stats(afl_state_t *);
void show_stats_normal(afl_state_t *);
void show_stats_pizza(afl_state_t *);
Expand Down
1 change: 1 addition & 0 deletions instrumentation/SanitizerCoveragePCGUARD.so.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1694,3 +1694,4 @@ std::string ModuleSanitizerCoverageAFL::getSectionEnd(
return "__stop___" + Section;

}

1 change: 1 addition & 0 deletions instrumentation/afl-llvm-dict2file.so.cc
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,4 @@ PreservedAnalyses AFLdict2filePass::run(Module &M, ModuleAnalysisManager &MAM) {
return PA;

}

1 change: 1 addition & 0 deletions instrumentation/afl-llvm-pass.so.cc
Original file line number Diff line number Diff line change
Expand Up @@ -831,3 +831,4 @@ PreservedAnalyses AFLCoverage::run(Module &M, ModuleAnalysisManager &MAM) {
return PreservedAnalyses();

}

1 change: 1 addition & 0 deletions instrumentation/cmplog-instructions-pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,4 @@ PreservedAnalyses CmpLogInstructions::run(Module &M,
return PreservedAnalyses();

}

1 change: 1 addition & 0 deletions instrumentation/injection-pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,4 @@ PreservedAnalyses InjectionRoutines::run(Module &M,
return PreservedAnalyses();

}

1 change: 1 addition & 0 deletions instrumentation/split-compares-pass.so.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1792,3 +1792,4 @@ PreservedAnalyses SplitComparesTransform::run(Module &M,
return PreservedAnalyses();

}

13 changes: 13 additions & 0 deletions src/afl-fuzz-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,19 @@ void plot_profile_data(afl_state_t *afl, struct queue_entry *q) {

}

/* Scroll the terminal so when the stats clear the screen
we don't delete anything. */

void make_space_for_stats() {

struct winsize ws;

if (ioctl(1, TIOCGWINSZ, &ws)) { return; }

SAYF("\x1b[%dS", ws.ws_row);

}

/* Check terminal dimensions after resize. */

static void check_term_size(afl_state_t *afl) {
Expand Down
2 changes: 2 additions & 0 deletions src/afl-fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -2978,6 +2978,8 @@ int main(int argc, char **argv_orig, char **envp) {

show_init_stats(afl);

if (!getenv("AFL_NO_UI") && !afl->not_on_tty) { make_space_for_stats(); }

if (unlikely(afl->old_seed_selection)) seek_to = find_start_position(afl);

afl->start_time = get_cur_time();
Expand Down
7 changes: 4 additions & 3 deletions utils/aflpp_driver/aflpp_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ extern "C" {
#endif

#if defined(__APPLE__) && defined(__MACH__)
#define SECTION_RODATA \
__attribute__((used, retain)) __attribute__((section("__RODATA,__" \
"rodata")))
#define SECTION_RODATA \
__attribute__((used, retain)) __attribute__(( \
section("__RODATA,__" \
"rodata")))
#else
#define SECTION_RODATA \
__attribute__((used, retain)) __attribute__((section(".rodata")))
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy