Skip to content

TRUEANGLE

BEAUTY AND PLAY

  • DOLLECT
  • Others
  • Configuration
  • AI
  • BLOG
  • ABOUT
    • ABOUT
    • Perception Style

How to compile a program to use electric fence library for debugging ?

Posted byjeffrin June 13, 2014
$cat efence-p1.c
#include <stdio.h>
#include <stdlib.h>
int main()
{

char *ptr = (char *) malloc(1024);
ptr[0] = 0;

ptr[1024] = 0;
exit(0);
}
$gcc -g efence-p1.c -lefence
$./a.out

Electric Fence 2.2 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>
Segmentation fault
$
Posted byjeffrinJune 13, 2014Posted inC, Debug Method Development, Programming LanguagesTags: electric fence debug

Post navigation

Previous Post Previous post:
Hacking with a program which has initialization of a MYSQL object
Next Post Next post:
How to check exit status of a command ?
June 2014
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« May   Jul »
TRUEANGLE, Proudly powered by WordPress.