Skip to content

rules.c: Simplify the latest bugfix to stacked rules #5725

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 3 commits into from
Mar 27, 2025

Conversation

magnumripper
Copy link
Member

@magnumripper magnumripper commented Mar 27, 2025

Just drop a couple of identical log_event() and move the last one so it covers all three

Also as a separate commit, add a log call just before session end that says how many candidates were processed.

See #5722

magnumripper and others added 2 commits March 27, 2025 18:23
Among other things, this is great for debugging.
Just drop a couple of redundant log_event and move the last one so it
covers all three.

See openwall#5722
If we're logging all of them, a large-ish wordfile run with many
stacked rules may produce petabytes worth of log file, not to mention
the performance penalty involved with that.
@magnumripper
Copy link
Member Author

Also added a commit requiring debug verbosity in order to log all stacked rules (otherwise only the first run of the stacked rules are logged, then a "Some rule logging suppressed. Re-enable with --verbosity=6 or greater"). Without this, we can very easily end up with petabytes worth of log file, and performance should plummet.

Copy link
Member

@solardiz solardiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me assuming you've tested it, but there's a lot more room for simplification and optimization.

@@ -1947,6 +1948,7 @@ static void john_done(void)
/* We already printed to stderr from signals.c */
log_event("%s", abort_msg);
} else if (children_ok) {
log_event("Candidates tried: %"PRIu64"p", status.cands);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also log suppressor's hits and misses, which is info that is otherwise impossible to access at session end (no way to press s at exactly the right moment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a new function in status.c, right? You could create a ticket for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a new function in status.c, right?

No, it's status.suppressor_hit and status.suppressor_miss just like status.cands that you use.

@magnumripper magnumripper merged commit 0e4e480 into openwall:bleeding-jumbo Mar 27, 2025
39 checks passed
@magnumripper magnumripper deleted the rules-stack-fixes branch March 27, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants