[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: C expert wanted
From:       "Christophe Prud'homme" <prudhomm () MIT ! EDU>
Date:       2001-10-01 13:46:35
[Download RAW message or body]

* Michael Häckel  [Monday 01 October 2001 05:40 am ]  :
   > The code looks like this:
   >   g_chunk = (uchar *)realloc(g_chunk, g_chunk_length = mIndexLength);
well this kind of bug is usually a pain in the heck
Sometimes I use electricfence  to help locate the _REAL_ location of the failure
http://metalab.unc.edu/pub/Linux/devel/lang/c/ElectricFence-2.0.5.tar.gz

I have attached a .gdbinit to this email 
to use it: 
gdb <your program>
type
efence
or  for underflow detection
underfence 

and to disable electricfence
nofence 

It is pretty good 
hope it  helps
C.
-- 
| Christophe Prud'homme, http://augustine.mit.edu/~prudhomm
| ICQ UIN: 24560867 Alias: Jesunix
|
| The Gnu Project's (gnu.org) General Public License (GPL) creates a
| commons of computer programs to which anyone may add but from which no
| one can subtract.

[".gdbinit" (text/plain)]

###############################################################################
# Electric Fence
#
# Debian's Electric Fence package provides efence as a shared library, which is
# very useful.
###############################################################################

define efence
        set environment EF_PROTECT_BELOW 0
        set environment LD_PRELOAD /usr/lib/libefence.so.0.0
        echo Enabled Electric Fence\n
end
document efence
Enable memory allocation debugging through Electric Fence (efence(3)).
        See also nofence and underfence.
end


define underfence
        set environment EF_PROTECT_BELOW 1
        set environment LD_PRELOAD /usr/lib/libefence.so.0.0
        echo Enabled Electric Fence for undeflow detection\n
end
document underfence
Enable memory allocation debugging for underflows through Electric Fence 
(efence(3)).
        See also nofence and underfence.
end


define nofence
        unset environment LD_PRELOAD
        echo Disabled Electric Fence\n
end
document nofence
Disable memory allocation debugging through Electric Fence (efence(3)).
end

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic