-
Notifications
You must be signed in to change notification settings - Fork 50
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
High CPU when fdm handed a strange spam Email in combination with questionable match rules #129
Comments
Hello Jeremy,
Mmm, why/what? (or, I couldn't understand what part of As a side note... I've definitely hit something similar too (I forgot details though, i.e. I forgot if the same RE was evaluated over and over for each single rule and that was the CPU intensive part) and to avoid that for all the headers that I would like to filter I have the following in
...and then I e.g.:
|
This has to do with how the documentation is written, I think. The mistake with my fdm.conf rules is my own regardless. Now that I've gone over the documentation more closely, it seems this IS valid syntax. The part of the rule syntax that lead to my mistake was this:
This is the only Thus, when I wrote my rules, I effectively expected these 2 rules to be identical, and they are very clearly not:
This is one of those situations where a BNF for fdm.conf would have made things more clear to me. That said: it still doesn't explain why fdm hits 100% CPU for 66+ seconds when fed this bizarre spam mail I received. |
I came across a very interesting edge case that manifests itself quite badly with fdm. A combination of a very strange spam Email alongside some questionably-written fdm.conf
match
rules resulted in fdm stalling on Email processing, taking a huge amount of CPU time (100%+), then after a very long time (60+ seconds) would continue yet still took up huge CPU amounts on subsequent (different) mails.I can tell the whole story if asked, but I'm trying to keep this bug report as on-topic as possible.
The Email I won't attach here because it contains some headers/private info in it, but just let me know where I can Email it (I'll base64 it first + send as an attachment). It's a syntactically-valid mail (mutt parses it just fine), and is not particularly large.
I spent a couple hours working out a simple reproduction case.
A
top
while things are running:If I don't Ctrl-C it, eventually it does get processed, but took over 60 seconds:
What I SHOULD have been using (and does not trigger the problem with the same strange spam Email):
fdm -n -f test.fdm.conf
does not complain about this questionable syntax, but the man page implies it should be considered invalid:The text was updated successfully, but these errors were encountered: