From: David C. <dcc...@ac...> - 2019-09-14 19:45:58
|
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 dcc...@ac... Chapman Consulting -- San Jose, CA EDA Software Developer, Expert Witness www.chapman-consulting-sj.com 2018-2019 Chair, IEEE Consultants' Network of Silicon Valley |