[vox-tech] electric fence - error in man page? a bug?

Jeff Newmiller vox-tech@lists.lugod.org
Tue, 21 Jan 2003 10:44:50 -0800 (PST)


On Tue, 21 Jan 2003, Peter Jay Salzman wrote:

> hola lugod,
> 
> according to the electric fence man page, pages of dynamic memory
> which are free'd are returned back to the heap from whence they came.
> in other words, if you do nothing, efence won't detect access of free'd
> dynamic memory.

That doesn't preclude Linux from detecting it.  Accessing free memory
produces undefined results... sometimes the library may return the memory
to the OS, and other times not (a function of buffering optimization).  
If it is returned, then the OS has the freedom to mark the page as outside
the process again, such that accesses there yield the same result
(SIGSEGV) as efence's forced behavior.

0 = sometimes detect error
1 = always detect error

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------