1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-11 07:22:22 +00:00

ElectricFence, the debugging malloc library

This commit is contained in:
James Raynard 1997-11-12 23:46:32 +00:00
parent c890f896ed
commit 28a5cee651
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=8597
6 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# New ports collection makefile for: sfio
# Version required: 2.0.5
# Date created: 13 November 1997
# Whom: jraynard
#
# $Id$
#
DISTNAME= ElectricFence-2.0.5
CATEGORIES= devel
MASTER_SITES= MASTER_SITE_LOCAL
MAINTAINER= jraynard@freebsd.org
MAN3= libefence.3
#do-build:
# @cd ${WRKDIR}/src/lib/sfio && ${MAKE} all -f makefile
# @cd ${WRKDIR}/src/lib/sfdisc && ${MAKE} all
do-install:
${INSTALL_DATA} ${WRKSRC}/libefence.a ${PREFIX}/lib
${INSTALL_MAN} ${WRKSRC}/libefence.3 ${PREFIX}/man/man3
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (ElectricFence-2.0.5.tar.gz) = d6a8459d2e9ef955eb4d3f76004617f8

View File

@ -0,0 +1,24 @@
--- Makefile.orig Fri Jan 20 05:33:04 1995
+++ Makefile Wed Nov 12 22:47:51 1997
@@ -4,7 +4,7 @@
INSTALL= install
MV= mv
CHMOD= chmod
-CFLAGS= -g
+CFLAGS+= -g -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
LIB_INSTALL_DIR= /usr/lib
MAN_INSTALL_DIR= /usr/man/man3
--- page.c.orig Wed Nov 12 21:57:13 1997
+++ page.c Wed Nov 12 23:19:57 1997
@@ -30,8 +30,10 @@
static caddr_t startAddr = (caddr_t) 0;
#if ( !defined(sgi) && !defined(_AIX) )
+#if ( !defined(BSD) || (BSD < 199103) )
extern int sys_nerr;
extern char * sys_errlist[];
+#endif
#endif
static const char *

View File

@ -0,0 +1 @@
A debugging malloc() that uses the VM hardware to detect buffer overruns.

View File

@ -0,0 +1,15 @@
Electric Fence is a different kind of malloc() debugger. It uses the virtual
memory hardware of your system to detect when software overruns the boundaries
of a malloc() buffer. It will also detect any accesses of memory that has
been released by free(). Because it uses the VM hardware for detection,
Electric Fence stops your program on the first instruction that causes
a bounds violation. It's then trivial to use a debugger to display the
offending statement.
It will probably port to any ANSI/POSIX system that provides mmap(), and
mprotect(), as long as mprotect() has the capability to turn off all access
to a memory page, and mmap() can use /dev/zero or the MAP_ANONYMOUS flag
to create virtual memory pages.
Complete information on the use of Electric Fence is in the manual page
libefence.3 .

View File

@ -0,0 +1,2 @@
lib/libefence.a
man/man3/libefence.3.gz