Subject: Re: mprotect(2) strange behaviour under compat linux
To: Matthias Drochner <M.Drochner@fz-juelich.de>
From: Nicolas Joly <firstname.lastname@example.org>
Date: 12/19/2007 14:06:07
On Tue, Dec 18, 2007 at 02:56:41PM +0100, Matthias Drochner wrote:
> email@example.com said:
> > Could this be a bug in memset from suse 10.0 glibc
> I wouldn't call it a bug. It is likely an optimisation
> to allocate a cache line in case the system doesn't do
> write allocation, thus avoiding write-through latency.
> This is legal. Depending on architecture and alignment
> there are cases where physical reads can't be avoided
> at all.
> Relying on write-only semantics is inherently non-portable.
In the mean time, i changed:
memset(buf, 0x0, len)
for (i = 0, p = buf; i < len; i++, p++) *p = 0x0;
Which does not exhibit the problem.
Biological Software and Databanks.
Institut Pasteur, Paris.