|
From: Fred S. <fs...@co...> - 2019-09-14 19:11:54
|
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!
Fred
CONFIDENTIALITY NOTICE: This message and attachments included are intended only for the addressee (s). The information contained in this message is confidential and may constitute proprietary or non-public information under international, federal, and/or state laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee(s), please promptly delete this message and notify the sender of the delivery error by e-mail.
|
|
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
|
|
From: John R. <jr...@bi...> - 2019-09-15 03:20:30
|
>> ==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)
[[snip]]
>> ==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)
>> The problem with that report is that line 231 contains no explicit code:
>> static HS_IF_STATE HS_send2HS (HS_out_thread * myoutthr,
[[snip]]
>> { ç line 231
>> I can’t find anything that’s allocated in that function that would be un-initialized later in the program,
As David Chapman replied earlier, then line 231 is the place where the compiler
constructed the stack frame.
Some local variable might be the destination of an assignment or copy from an
uninit variable. In order to help find this, then re-run with the valgrind
command-line option
--track-origins=yes
which should give more information about the provenance of the uninit value.
|
|
From: Fred S. <fs...@co...> - 2019-09-15 21:30:52
|
John, thanks for the reply!
Actually, that was run with track-origins. I seem to recall a few years ago it gave more detail than it is now. This is 3.15, latest released version.
I wish I could debug into those Oracle libraries, it would make it a lot easier to track what it's complaining about.
I asked about bogus error messages because I saw a comment in the user doc about sometimes Valgrind produces erroneous messages, and I was hoping to find out if this might be one of them, given the difficulty of tracking down whatever the complaint is about. ☹
Fred
> -----Original Message-----
> From: John Reiser <jr...@bi...>
> Sent: Saturday, September 14, 2019 11:20 PM
> To: val...@li...
> Subject: Re: [Valgrind-users] seemingly bogus error reports
>
> >> ==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)
> [[snip]]
> >> ==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)
>
> >> The problem with that report is that line 231 contains no explicit code:
> >> static HS_IF_STATE HS_send2HS (HS_out_thread * myoutthr,
> [[snip]]
> >> { ç line 231
>
> >> I can’t find anything that’s allocated in that function that would be
> >> un-initialized later in the program,
>
> As David Chapman replied earlier, then line 231 is the place where the
> compiler constructed the stack frame.
>
> Some local variable might be the destination of an assignment or copy from
> an uninit variable. In order to help find this, then re-run with the valgrind
> command-line option
> --track-origins=yes
> which should give more information about the provenance of the uninit
> value.
>
>
>
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> sourceforge.net%2Flists%2Flistinfo%2Fvalgrind-
> users&data=01%7C01%7Cfsmith%40computrition.com%7C22bc32ce525
> d4d77a75508d7398bd996%7C3b4088f40055447db060d8040059e8f9%7C0&am
> p;sdata=nptwy1yjpQIBttwRW4kryi0m38saSmFNQi3i2lY7UAI%3D&reserv
> ed=0
CONFIDENTIALITY NOTICE: This message and attachments included are intended only for the addressee (s). The information contained in this message is confidential and may constitute proprietary or non-public information under international, federal, and/or state laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee(s), please promptly delete this message and notify the sender of the delivery error by e-mail.
|
|
From: Julian S. <js...@ac...> - 2020-01-02 09:03:30
|
On 14/09/2019 21:11, 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: Try again with the trunk now (git clone git://sourceware.org/git/valgrind.git). I just pushed a bunch of changes in, aimed at reducing the false positive level on optimised code, relating to transformations to do with C-level &&/|| expressions. J |