Re: seemingly bogus error reports

David Chapman <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Organization Chapman Consulting
Message-ID <[email protected]>
On 9/14/2019 12:11 PM, Fred Smith wrote:
>
> Hi all!
>
> IÂ’m new to this list, but have used Valgrind many times in the past.
>
> Today IÂ’m making a serious effort to clean up a non-trivial body of 
> code, and have run into a number of error reports like this one:
>
> ==00:00:00:11.329 1533== Conditional jump or move depends on 
> uninitialised value(s)
>
> ==00:00:00:11.329 1533==    at 0x7B0BCC2: ttci2n (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7B20DF5: ttcacs (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7AF2503: ttcdrv (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7AE14C8: nioqwa (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7AC35CB: upirtrc (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7ACDDE5: kpurcsc (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7AC710D: kpuexec (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x7AC3F78: OCIStmtExecute (in 
> /home/interface/interface/oralib-12/lib/libclntsh.so.12.1)
>
> ==00:00:00:11.329 1533==    by 0x45078D: HS_do_OCI_stuff (HS_oci.c:1460)
>
> ==00:00:00:11.329 1533==    by 0x407DA0: HS_send2HS (HS_thr_out.c:261)
>
> ==00:00:00:11.329 1533==    by 0x4083BB: HS_convertandsend 
> (HS_thr_out.c:468)
>
> ==00:00:00:11.329 1533==    by 0x40884E: HS_out_msg (HS_thr_out.c:629)
>
> ==00:00:00:11.329 1533==    by 0x40913C: HS_out_main (HS_thr_out.c:933)
>
> ==00:00:00:11.329 1533==    by 0x409797: HS_main_out (HS_thr_out.c:1172)
>
> ==00:00:00:11.329 1533==    by 0x9C50DD4: start_thread 
> (pthread_create.c:307)
>
> ==00:00:00:11.329 1533==  Uninitialised value was created by a stack 
> allocation
>
> ==00:00:00:11.329 1533==    at 0x407C67: HS_send2HS (HS_thr_out.c:231)
>
> ==00:00:00:11.329 1533==
>
> The problem with that report is that line 231 contains no explicit code:
>
> static HS_IF_STATE HS_send2HS (HS_out_thread * myoutthr,
>
>                                 HS_MSGBUF * msgbuf,
>
>                                 HS_IF_PARMS * ifparms,
>
>                                 xmlChar * xmlbufptr,
>
>                                 char * HS_resp,
>
>                                 HS_patdat * patdat,
>
>                                 char * databuf)
>
> { ç line 231
>
>                 HS_IF_STATE status = OK;
>
>                 int success, warnings;
>
>                 int numtries = 0
>
> I canÂ’t find anything thatÂ’s allocated in that function that would be 
> un-initialized later in the program, and I donÂ’t know what it thinks 
> is on line 231.
>
> Advice will be appreciated, thanks in advance!
>

The allocation is probably in the function's stack frame, which would be 
set up at function entry.  The compiler probably assigned line 231 to 
that task.  I see line 261 in your call stack; what local variables does 
it use?

-- 
     David Chapman      [email protected]
     Chapman Consulting -- San Jose, CA
     EDA Software Developer, Expert Witness
     www.chapman-consulting-sj.com
     2018-2019 Chair, IEEE Consultants' Network of Silicon Valley

_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.