bogotune bug in -v mode

David Relson relson at osagesoftware.com
Fri Dec 3 03:42:45 CET 2004


On Fri, 03 Dec 2004 01:47:23 +0100
Matthias Andree wrote:

> David, Greg,
> 
> "bogotune -D -n gut -s schlecht -v" crashes here:
> 
> #7  0x0805d933 in rstats_fini (robn=6, P={mant =
9.2929390950634053e-05, exp = 0}, Q={mant = 0.0020635897044632388, exp =
0}, spamicity=0)
>     at ../../src/rstats.c:121
> #8  0x08054bea in msg_compute_spamicity (wh=0x811a030, fp=0x0) at
../../src/score.c:265
> #9  0x0804a819 in score_ns (results=0x8c02db0) at
../../src/bogotune.c:369
> #10 0x0804d363 in bogotune () at ../../src/bogotune.c:1606
> #11 0x0804d852 in main (argc=0, argv=0x0) at ../../src/bogotune.c:1729
> 
> The problem is that stats_head is NULL. msg_compute_spamicity appears
to
> assumes it needs to run rstats_fini because verbose is set.

rstats_init() is only called from score_initialize() which isn't run
from bogotune.  Since none of the rstats_xyz() functions aren't needed
for bogotune, the simple fix is to call them only when fBogotune is
false.  Since their calls already depend on need_stats being true, the
simple fix is to include "&& !fBogotune" when setting need_stats.

I'm in process of testing that now ...

Good catch in finding the bug!

David



More information about the bogofilter-dev mailing list