This might seem like a silly question but valgrind doesn’t by default give you quite enough information. Valgrind reports the following:
==2541== Conditional jump or move depends on uninitialised value(s)
==2541== at 0x401777: process_read.clone.3 (in /home/matt/dev/ocs/client3/a.out)
==2541== by 0x4026B8: obbs_main (in /home/matt/dev/ocs/client3/client)
==2541== by 0x53D1D8B: start_thread (pthread_create.c:304)
==2541== by 0x511D04C: clone (clone.S:112)
I can’t see anything obvious. Valgrind -v also doesn’t help.
Is there a way to get valgrind to tell me which values are uninitialsed?
If you use the
--track-origins=yesflag with valgrind it will tell you the line number (assuming you compiled with -g) where the unitialized memory was first allocated. This is usually at the stack allocation at the beginning of a function somewhere.Try compiling with -Wall as well. -Wall should catch most “used uninitialized” errors at compile time.