> What you can further do is to use the memcheck monitor commands to
> examine the definedness of the variables used on the line where the
> error is detected.
>
> See manual for more info
> http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.monitor-commands

Thanks, I didn't know about the "monitor get_vbits" command.

However, it seems I'm not able to catch any uninitialized variable. I 
also get this kind of error in another library:

==17108== Use of uninitialised value of size 8
==17108==    at 0x60BDB6D: decode_rs_char (decode_rs.h:118)
==17108==    by 0x41D9B5: Code::decode(unsigned char*, int*, unsigned 
int, bool) (Code.cpp:114)
==17108==    by 0x41E6D8: Code::extract(char*, char*, std::string&, 
unsigned int) (Code.cpp:326)
==17108==    by 0x4060E4: main (test.cpp:178)
==17108==  Uninitialised value was created by a stack allocation
==17108==    at 0x60BD480: decode_rs_char (decode_rs_char.c:15)

And with vgdb I get this in gdb:

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000000060bdb6d in decode_rs_char (p=0x201aac50, data=0xffefff500 "",
     eras_pos=0xffefff480, no_eras=22) at decode_rs.h:118
118             tmp = INDEX_OF[lambda[j - 1]];

I tried the get_vbits command in variables p, data, eras_pos and 
no_eras. I had to manually find out the size of the corresponding 
variables, since some of them are pointers or structs with pointer fields.

I seem to have computed the corresponding sizes correctly since if I use 
a size 1 byte larger in the vget_bits command I get an "unaddressable" 
warning (also represented by the underscore).

When you say "local variables" you mean the variables the function 
received as argument or all variables defined inside the function?

I think I know the answer, since I remember having discussed this in the 
mailing list: all variables inside the function are local, thus 
allocated in the stack, so valgrind is not yet able to detect errors in 
them? Can you confirm this?

I have to try using exp-sgcheck, right?

Thanks.

-- 
João M. S. Silva

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to