Electric Fence (or eFence) is a memory debugger written by Bruce Perens. It consists of a library which programmers can link into their code to override the C standard library memory management functions. eFence triggers a program crash when the memory error occurs, so a debugger can be used to inspect the code that caused the error.
Electric Fence is intended to find two common types of programming bugs:
- Overrunning the end (or beginning) of a dynamically allocated buffer
- Using a dynamically allocated buffer after returning it to the heap
In both cases, Electric Fence causes the errant program to abort immediately via a segmentation fault. Normally, these two errors would cause heap corruption, which would manifest itself only much later, usually in unrelated ways. Thus, Electric Fence helps programmers find the precise location of memory programming errors.
Electric Fence allocates at least two pages (often 8KB) for every allocated buffer. In some modes of operation, it does not deallocate freed buffers. Thus, Electric Fence vastly increases the memory requirements of programs being debugged. This leads to the recommendation that programmers should apply Electric Fence to smaller programs when possible, and should never leave Electric Fence linked against production code.
Electric Fence is free software licensed under the GNU General Public License. Last version (2.1.13) was released 2003-12-07.
Famous quotes containing the words electric fence, electric and/or fence:
“The widest prairies have electric fences....”
—Philip Larkin (19221986)
“Flabby, bald, lobotomized,
he drifted in a sheepish calm,
where no agonizing reappraisal
jarred his concentration of the electric chair
hanging like an oasis in his air
of lost connections. . . .”
—Robert Lowell (19171977)
“Does Job fear God for nothing? Have you not put a fence around him and his house and all that he has, on every side? You have blessed the work of his hands, and his possessions have increased in the land. But stretch out your hand now, and touch all that he has, and he will curse you to your face.”
—Bible: Hebrew, Job 1:9-11.
Satan to God.