Re: [Exim] Re: [SA-exim] local_scan is crashing (log_write c…

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc MERLIN
Data:  
A: Adam D. Barratt, sa-exim
CC: Brian Kendig, Exim-users
Assumpte: Re: [Exim] Re: [SA-exim] local_scan is crashing (log_write crash)
[Reply-To: sa-exim@???]

On Sun, May 23, 2004 at 03:33:17PM +0100, Adam D. Barratt wrote:
> > That did the trick, thank you very much! I changed this line, as well
> > as two debug lines I found which try to print fdsize-18.
>
> It should probably be (double)(fdsize - 18) so that it still works on
> platforms where sizeof(off_t) != 8 (i.e. most of them *g*).


Adam, thanks for finding all this.
I can't believe I made that stupid mistake, I should know better.
At least, I did define fdstart as an off_t, and not an int, but I completely
forgot that (s)printf (which I'm guessing exim uses internally for
log_write) doesn't actually convert types (I've one way too much perl in the
last years, one gets lazy after that)

> > Why does this fix work? I figure "%.0f" means a floating-point value
> > with no decimal places, but why does displaying the number as a float
> > instead of a decimal solve the problem?
>
> "%%d" *isn't* (just) "a decimal", it's a synonym for "%i", and thus an
> /int/. On many (probably still most) platforms, sizeof(int) ==


Yeah, that was my mistake. Stuff like that works in higher level languages
were %d really does mean decimal.

Again, thanks for the analysis, I'll put out a new sa-exim with this and a
few other fixes soon.

Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/   |   Finger marc_f@??? for PGP key