ElectricFence

Matthias Andree matthias.andree at gmx.de
Fri Jan 10 14:17:38 CET 2003


[resend; because David's mail was Cc:d to myself, I originally replied
to him only rather than the list. Please avoid Cc:ing me on list
replies.]

On Thu, 09 Jan 2003, David Relson wrote:

> An interesting finding with ElectricFence.  As I suspect you know, 
> ElectricFence complains about three of the regression tests, specifically 
> t.integrity, t.integrity2, and t.ignore_spam_header.
> 
> What's interesting about these tests is that bogofilter is run with input 
> that doesn't contain any tokens.  When the code gets to rstats_print() 
> there are 0 tokens to print.  This function allocates memory so it can sort 
> the array of tokens.  With no tokens, the allocation call becomes 
> xcalloc(0, 4).  By forcing the count to 1 (instead of 0), all the tests 
> PASS with ElectricFence becomes happy with this test.

There is nothing to fix in our code, only that our treatment of the
condition doesn't work because efence aborts the program before we get
to retry with nonzero malloc(). All the code is in your x-... memory
allocation functions.

The (indeed correct) fix is to export EF_ALLOW_MALLOC_0=1 before running
efence tests. You'll need to export more environment variables for
efence configuration to get /useful/ results.

-- 
Matthias Andree




More information about the bogofilter-dev mailing list