boundarydevices / efence Goto Github PK
View Code? Open in Web Editor NEWefence Malloc debugger
License: GNU General Public License v2.0
efence Malloc debugger
License: GNU General Public License v2.0
This is Electric Fence 2.2 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. This version should run on all systems that support POSIX mmap() and mprotect(). This includes Linux, Unix, and I think even BeOS. Complete information on the use of Electric Fence is in the manual page efence.3 . There is a mailing list to support Electric Fence. You can subscribe to it using the web form at http://lists.perens.com/mailman/listinfo/electric-fence. Thanks Bruce Perens [email protected]
max@Workstation:~/efence$
max@Workstation:~/efence$ make
cc -g -DUSE_SEMAPHORE -fPIC -c efence.c -o efence.o
cc -g -DUSE_SEMAPHORE -fPIC -c page.c -o page.o
cc -g -DUSE_SEMAPHORE -fPIC -c print.c -o print.o
In file included from efence.h:3,
from print.c:8:
print.c: In function ‘EF_Printv’:
print.c:218:66: warning: ‘char’ is promoted to ‘int’ when passed through ‘...’
218 | char c = va_arg(args, char);
| ^
print.c:218:66: note: (so you should pass ‘int’ not ‘char’ to ‘va_arg’)
print.c:218:66: note: if this code is reached, the program will abort
rm -f libefence.a
ar crv libefence.a efence.o page.o print.o
a - efence.o
a - page.o
a - print.o
gcc -g -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
efence.o page.o print.o -lpthread -lc
cc -g -DUSE_SEMAPHORE -fPIC -c tstheap.c -o tstheap.o
rm -f tstheap
cc -g -DUSE_SEMAPHORE -fPIC tstheap.o libefence.a -o tstheap -lpthread
/usr/bin/ld: libefence.a(page.o): in function `stringErrorReport':
/home/max/efence/page.c:57: undefined reference to `sys_nerr'
/usr/bin/ld: /home/max/efence/page.c:58: undefined reference to `sys_errlist'
collect2: error: ld returned 1 exit status
make: *** [Makefile:62: tstheap] Error 1
max@Workstation:~/efence$ sudo make
rm -f tstheap
cc -g -DUSE_SEMAPHORE -fPIC tstheap.o libefence.a -o tstheap -lpthread
/usr/bin/ld: libefence.a(page.o): in function `stringErrorReport':
/home/max/efence/page.c:57: undefined reference to `sys_nerr'
/usr/bin/ld: /home/max/efence/page.c:58: undefined reference to `sys_errlist'
collect2: error: ld returned 1 exit status
make: *** [Makefile:62: tstheap] Error 1
max@Workstation:~/efence$ sudo make install
install -m 755 ef.sh /usr/bin/ef
install -m 644 libefence.a /usr/lib
install -m 755 libefence.so.0.0 /usr/lib
rm -f /usr/lib/libefence.so.0
ln -s libefence.so.0.0 /usr/lib/libefence.so.0
rm -f /usr/lib/libefence.so
ln -s libefence.so.0.0 /usr/lib/libefence.so
install -m 644 efence.3 /usr/man/man3/efence.3
install: cannot create regular file '/usr/man/man3/efence.3': No such file or directory
make: *** [Makefile:37: install] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.