fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] about that fetchmail imap message count vulnerability and alloca()

2002-07-05 06:08:03
Em Thu, Jul 04, 2002 at 03:37:07PM +0200, Matthias Andree escreveu:
So, what's the point in using it anyway? I didn't get a segfault 
alloca()ting
1Gb of memory, but the next printf() in my sample program crashed. Isn't
that too much instability for fetchmail?

Well, you cannot expect to be able to recover from out-of-memory
conditions anyways. As competing processes fight for memory, you may
lose memory you intended to use for a graceful exit, like saving state
or something. Indeed, that's vexing, but such is life with multi-tasking
operating systems.

I can't believe I'm reading this, I truly hope I'm mistaken. I think you
are talking about the situation where one has the overcommit bit enabled.

Or are you truly saying that it's OK for that function to return an invalid 
pointer
and that we should live with it, just waiting for the next segfault to
happen? What's the point?

I don't know on which system fetchmail is developed, probably a system
where alloca works as expected, returning NULL when the requested
ammount of memory is not available (as the manpage says it should).

BTW, there is a local implementation of alloca included in the fetchmail
source, I'll try that one.