|
From: Thomas L. <tho...@jr...> - 2004-02-16 14:40:57
|
Hi all! My program is quite unstable and I tried to use Valgrind to help me in detecting my memory-usage errors. It detects an error which I am quite confident should be a big destabilizing one, but the error message is too lazy: ==14006== Use of uninitialised value of size 4 ==14006== at 0x805BB27: InteraGetProba (interaction.c:433) ==14006== by 0x8052002: PathSpread (path.c:434) ==14006== by 0x8072944: DoExpe (expe.c:271) ==14006== by 0x8070208: MeasureApply (measuredef.c:171) And nothing else. This source-code line (interaction.c:433) is a quite complex line with pointer to function and many pointer arguments. Is there a way to have Valgrind display messages in a more acurrate way? I also attached the process to gdb (--gdb-attach=yes) but I still cannot locate which variable is used as uninitialised. I must admit I am not a guru of gdb either. If there is a simple way to locate which variable is used as uninitialized in gdb, you can tell it to me too :-) Any clue? Thanks anyway, Thomas |
|
From: Jorrit T. <Jor...@uz...> - 2004-02-16 14:52:15
|
Thomas Lavergne wrote:
> Hi all!
> My program is quite unstable and I tried to use Valgrind to help me in
> detecting my memory-usage errors.
> It detects an error which I am quite confident should be a big
> destabilizing one, but the error message is too lazy:
> ==14006== Use of uninitialised value of size 4
> ==14006== at 0x805BB27: InteraGetProba (interaction.c:433)
> ==14006== by 0x8052002: PathSpread (path.c:434)
> ==14006== by 0x8072944: DoExpe (expe.c:271)
> ==14006== by 0x8070208: MeasureApply (measuredef.c:171)
> And nothing else. This source-code line (interaction.c:433) is a quite
> complex line with pointer to function and many pointer arguments.
> Is there a way to have Valgrind display messages in a more acurrate way?
> I also attached the process to gdb (--gdb-attach=yes) but I still
> cannot locate which variable is used as uninitialised. I must admit I
> am not a guru of gdb either. If there is a simple way to locate which
> variable is used as uninitialized in gdb, you can tell it to me too :-)
What about trying to make the expression simpler? i.e. instead of:
int a = b+c+d+e*f;
you could do:
int a1 = b+c;
int a2 = d+e*f;
int a = a1+a2;
(just an example).
Perhaps valgrind can pinpoint the problem more exactly then and it is a
good idea
to do this in any case.
Greetings,
>
> Any clue?
> Thanks anyway,
> Thomas
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
|