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

List:       kde-devel
Subject:    SOLVED: C expert wanted
From:       Michael =?iso-8859-1?q?H=E4ckel?= <Michael () Haeckel ! Net>
Date:       2001-10-01 16:13:49
[Download RAW message or body]

Hi,

On Monday 01 October 2001 15:46, Christophe Prud'homme wrote:
> * 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

Thanks to all who replied, I finally found the bug.

Simply calling realloc nearly always, when the variable is used showed the 
code that caused the memory corruption.
Yes, the hint with -24 was not that bad. Some offset was indeed negative due 
to the limited range of a short int.

Maybe I'll try you tool next time. :-)

Regards,
Michael Häckel
 
>> 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