On Dec 23, 2010, at 3:57 PM CST, Osman, Ahmed wrote:
> Hi Dave,
> I added it and thisis the report.
[...]
> ==9502== Uninitialised value was created by a stack allocation
> ==9502== at 0x88B393D: sortReadersWriters (db_if.c:7021)
> ==9502==
>
> What could be the problem? as the line 7021 is this:
> static void sortReadersWriters(const char * name, int lbound, int isUp,
> int len,
> dataflow_symtab_rec *rec,
> dataflow_name_rec** rw_arr,
> handle obj)
> {
Valgrind is telling you that the uninitialized value is coming from a variable
allocated on the stack upon entering that function. For example, the following
code would elicit an error like this:
----8<----
void func(void)
{
int i;
if (i > 5) { /*...*/ }
}
----8<----
Because "i" was never initialized, it has an undefined (garbage) value.
So in your case, take a look at any local variables that are declared in that
function and see if they are used on line 7071. Then make sure that they will
always have been initialized by the time you reach that line.
-Dave
> -----Original Message-----
> From: Dave Goodell [mailto:[email protected]]
> Sent: Thursday, December 23, 2010 10:52 AM
> To: Dallman, John
> Cc: Osman, Ahmed; [email protected]
> Subject: Re: [Valgrind-users] False report
>
> On Dec 23, 2010, at 12:25 PM CST, Dallman, John wrote:
>
>>> It appears that everything used in that line is set. Might
>>> valgrind not recognize the values set to idx and length in
>>> the call to sscanf()?
>>
>> With puzzling things like this, try simply printing the values in
>> question with printf(). This usually clarifies the situation.
>
> Passing "--track-origins=yes" to Valgrind also helps when hunting down
> "uninitialised value" warnings. As a bonus, you don't need to recompile
> the program to use this strategy.
>
> -Dave
>
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users