Closed (fixed)
Project:
Spam
Version:
master
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
8 Sep 2005 at 02:07 UTC
Updated:
24 Oct 2005 at 03:40 UTC
I get the following error in the logs whenever I manually mark a message as either spam or not spam:
Division by zero in /usr/local/share/drupal-4.6.3/modules/spam-2.0.10/spam.module on line 961.
It doesn't *seem* to be having any negative effects, but I can't be sure. I do know that the bayesian filter is a little wonky... it flagged a recent non-spam comment as spam with an 85% chance, and I have absolutely no idea what it triggered on; there didn't seem to be anything remotely spammy about it.
Comments
Comment #1
Zed Pobre commentedAs an additional note, I'm running Drupal on Postgresql, which may be a contributing factor.
Comment #2
jeremy commentedPlease try this version of the module and let me know if the problem goes away.
You can see just the fix here.
It would be worth reviewing your tokens table to see if the values look sane. If they don't, or if you're not sure, I'd recommend dropping the table and recreating it in case there is bad data in there.
BTW: To determine why the module marked a given comment as spam, go to administer >> settings >> spam and at the bottom configure the module to Log "everything". On the next comment that is mis-marked, go to administer >> comments >> spam and click "view log" -- it will give you a token by token breakdown of how it came up with the spam probability.
Comment #3
Zed Pobre commentedThe tokens table had a number of tokens with negative values for either number of spam or not-spam messages, so I dropped it and recreated it. The division by zero error seems to have gone away in 2.0.12pre.
Thanks.
Comment #4
jeremy commentedThat reminds me, there's a second place I need to make that change. You should upgrade to this version or later, or your token table will get corrupted again. View the changes here.
BTW: The changes to spam_duplicate_filter() are unrelated, just another little bug I found recently.
Does everything else seem to be working for you in the spam module with PostgreSQL?
Comment #5
Zed Pobre commentedYour link is broken; it goes back to the version you put up a few days ago. I just manually entered the changes from the posted diff, though, and we'll see how it goes. I *do* have negative numbers again. I'm just going to set all of the negative values to zero, rather than lose all the data this time, unless you think that's a very bad idea.
I am having a new problem, though, and a much more serious one. Ever since I updated to the 2.0.12pre a few days ago, the spam.module has stopped taking action on trackbacks. I checked the configuration, and it is still set to do so. I will have to revert to 2.0.10 if the source of that problem can't be found soon; I'm already being inundated with spam, and I even have a large number of IPs already filtered via iptables, so I'm stopping a few hundred attempts a day before it even hits the webserver.
If you have a version of your comment.module patch against the 2.6.3 version, that would be great.
Comment #6
jeremy commented> I'm just going to set all of the negative values to zero, rather than lose
> all the data this time, unless you think that's a very bad idea.
Keep an eye on it and let me know how it goes. Personally, I would drop the tokens table and start over, as the data is already corrupt. They Bayesian filter is intended as a last-chance effort to catch spam, it's the other mechanisms that tend to catch the bulk of spam.
> I am having a new problem, though, and a much more serious one. Ever since
> I updated to the 2.0.12pre a few days ago, the spam.module has stopped
> taking action on trackbacks.
You need to apply the patch found here. The spam module API changed, unfortunately this change hasn't yet been merged into the trackback module.
Comment #7
Zed Pobre commentedThat worked, and spam.module is now once again blocking trackbacks properly. I've posted another bug with the tokens table, but there weren't that many negative values to correct, and I think a few off-by-one (or at most, off-by-four) calculations won't create too much trouble.
Comment #8
Zed Pobre commentedWhoops. I'm getting fresh division by zero errors, possibly related to a failure to detect existing tokens:
Comment #9
Zed Pobre commentedDisregard, sorry.
That last was a side-effect of a change I made to trackback.module while testing a corrected query string.
Comment #10
jeremy commentedUpdating status, will be marked fixed when 2.0.12 is released.
Comment #11
jeremy commentedFixed in 2.0.12.
Comment #12
(not verified) commented