[Exim] BUG: exim 4.20 crashes while debugging in receive_che…

Top Page
Delete this message
Reply to this message
Author: Peter A. Savitch
Date:  
To: Philip Hazel
CC: exim-users
Subject: [Exim] BUG: exim 4.20 crashes while debugging in receive_check_fs(), file src/receive.c(137)
Hello Philip,

I have noticed the following issue.
When I set check_spool_space global option (and check_spool_inodes,
etc) and run exim in a such environment when STATVFS() yields EACCESS.
My spool directory was misconfigured and inaccessible, STATVFS is
statfs(2) on my system. So,

1) exim reports "421 Space shortage" while NOT in debugging
2) exim crashes with SIGFPE while debugging

This happens because a debugging code in receive_check_fs() executes a
division by zero. Members of "struct STATVFS statbuf" are being zeroed
at src/recieve.c(124), so debug_printf MUST NOT use expressions like
(int)(msg_size / statbuf.F_FRSIZE) without checking for zero values in
a denominator.

A little bit confusing bug. Normally, first time I run a
"just-configured" exim I run it with -d option. A SIGFPE that happens
after first MAIL FROM command *really* confuses me ;-)

Philip, maybe it's better to throw panic immediately when STATVFS()
fails and check_XXXX options being used? Or just in case of EACCESS?

Thanks.
--
Best regards,
 Peter                          mailto:spam4octan@highway.ru