Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Feb 2002 01:04:26 -0800
From:      Ben Jackson <ben@ben.com>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   a note about configure, off_t and struct stat
Message-ID:  <200202040904.g1494Q848838@pulsar.home.ben.com>

next in thread | raw e-mail | index | archive | help
I'd like to preserve this for posterity, so I'm hoping the list will accept
this (I'm not subscribed) so that others may benefit from the archives.
I hope no one else ever has to spend the 10 hours on this I did!

IF for some reason configure decides that your system does not define
`off_t' it will put `#define off_t long' in config.h.  Among other things,
this will makes struct stat 4 bytes shorter.  This means that calls to
stat() will now stomp on memory every time it's called.  With auto
variables you might get lucky and hit things like return addresses!
Much fun ensues.

You could probably also get crazy results from mmap() and other things
taking off_t which you are sure you have the prototype for but are getting
32 bit quantities anyway.

For some reason the two things that this bit me on were bonobo-conf
and ximian evolution.  For whatever reason, db-3.1.17 (if you've built
evolution you know what I mean) which I built at the same time detected
off_t fine and didn't have this problem.

--Ben

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202040904.g1494Q848838>