Re: [exim-dev] memory corruption issues

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: Jeremy Harris
CC: exim-dev
Subject: Re: [exim-dev] memory corruption issues
On 2012-10-14 at 23:50 +0100, Jeremy Harris wrote:
> Any developers suffering like I was with odd crash issues
> might like to look into this possibility. I'm not sure how
> well the restrictions on memory use in exim are documented,
> but it wasn't one I'd realised.
>
> If your code does any allocation, which pretty much means
> any variable- or string-handling, and expects the results
> to stay around (like in a variable): check the call-chains
> leading to your code for use of store_reset(). If one is done
> it sets you up for a much-later alloc to hand out your memory
> again, hence corruption.


You can also use store_get_perm(), or temporarily set "store_pool =
POOL_PERM" before grabbing the data with the normal functions.

Bear in mind that delivery, etc, will take place from a different
process, which reads data off the spool, so the spool_write_header()
calls protect a lot of data for you. I think that's the reason we're
not bitten by the authenticators not storing the auth vars in permanent
store, and so that's not actually a bug.

-Phil