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

Marc MERLIN <[email protected]>
Newsgroups gmane.mail.exim.spamassassin
Message-ID <[email protected]>
On Sun, May 23, 2004 at 09:11:37PM -0700, Marc MERLIN wrote:
> 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.

Just to say that I haven't entirely disappeared, it's in the CVS tree of
my laptop. The changes were pretty big to fix all that 64 bit-ness into
printf (via log_write). I'll need to test this a bit after the plane
lands and I can sync up all this and throw real mail at it.

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.