Skip to content

Commit

Permalink
put a bandaid on trace-level logging bug
Browse files Browse the repository at this point in the history
  • Loading branch information
epi052 committed Sep 7, 2024
1 parent 0f304ab commit 6157df7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/config/container.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
use super::utils::{
backup_extensions, depth, extract_links, ignored_extensions, methods, parse_request_file,
report_and_exit, request_protocol, save_state, serialized_type, split_header, split_query,
status_codes, threads, timeout, user_agent, wordlist, OutputLevel, RequesterPolicy,
backup_extensions, depth, determine_requester_policy, extract_links, ignored_extensions,
methods, parse_request_file, report_and_exit, request_protocol, save_state, serialized_type,
split_header, split_query, status_codes, threads, timeout, user_agent, wordlist, OutputLevel,
RequesterPolicy,
};

use crate::config::determine_output_level;
use crate::config::utils::determine_requester_policy;
use crate::{
client, parser,
scan_manager::resume_scan,
traits::FeroxSerialize,
utils::{fmt_err, parse_url_with_raw_path},
utils::{fmt_err, module_colorizer, parse_url_with_raw_path, status_colorizer},
DEFAULT_CONFIG_NAME,
};
use anyhow::{anyhow, Context, Result};
Expand Down Expand Up @@ -914,6 +915,26 @@ impl Configuration {
// occurrences_of returns 0 if none are found; this is protected in
// an if block for the same reason as the quiet option
config.verbosity = args.get_count("verbosity");

// todo: starting on 2.11.0 (907-dont-skip-dir-listings), trace-level
// logging started causing the following error:
//
// thread 'tokio-runtime-worker' has overflowed its stack
// fatal runtime error: stack overflow
// Aborted (core dumped)
//
// as a temporary fix, we'll disable trace logging to prevent the stack
// overflow until I get time to investigate the root cause
if config.verbosity > 3 {
eprintln!(
"{} {}: {}",
status_colorizer("WRN"),
module_colorizer("Configuration::parse_cli_args"),
"Trace level logging is disabled; setting log level to debug"

Check failure on line 933 in src/config/container.rs

View workflow job for this annotation

GitHub Actions / Clippy

literal with an empty format string

Check failure on line 933 in src/config/container.rs

View workflow job for this annotation

GitHub Actions / Clippy

literal with an empty format string
);

config.verbosity = 3;
}
}

if came_from_cli!(args, "no_recursion") {
Expand Down
2 changes: 2 additions & 0 deletions tests/test_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ fn scanner_single_request_scan_with_filtered_result() -> Result<(), Box<dyn std:
}

#[test]
#[should_panic] // added in 2.11.0 for panicking trace-level logging
/// send a single valid request, get a response, and write the logging messages to disk
fn scanner_single_request_scan_with_debug_logging() {
let srv = MockServer::start();
Expand Down Expand Up @@ -467,6 +468,7 @@ fn scanner_single_request_scan_with_debug_logging() {
}

#[test]
#[should_panic] // added in 2.11.0 for panicking trace-level logging
/// send a single valid request, get a response, and write the logging messages to disk as NDJSON
fn scanner_single_request_scan_with_debug_logging_as_json() {
let srv = MockServer::start();
Expand Down

0 comments on commit 6157df7

Please sign in to comment.