Re: [Exim] Re: local_scan is crashing (log_write crash)

Marc MERLIN <[email protected]>
Newsgroups gmane.mail.exim.spamassassin,gmane.mail.exim.user
Message-ID <[email protected]>
[Reply-To: [email protected]]

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 [email protected] for PGP key
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.