Conditional jump or move depends on uninitialised value(s)
Arondight opened this issue · 1 comments
Arondight commented
I think this is not a bug but need to find out what happend.
$ sudo valgrind --leak-check=full --show-reachable=yes --trace-children=yes -v ../bin/sudodevd
==7792== Memcheck, a memory error detector
==7792== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==7792== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==7792== Command: ../bin/sudodevd
==7792==
--7792-- Valgrind options:
--7792-- --leak-check=full
--7792-- --show-reachable=yes
--7792-- --trace-children=yes
--7792-- -v
--7792-- Contents of /proc/version:
--7792-- Linux version 4.6.2-1-ARCH (builduser@tobias) (gcc version 6.1.1 20160602 (GCC) ) #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016
--7792--
--7792-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--7792-- Page sizes: currently 4096, max supported 4096
--7792-- Valgrind library directory: /usr/lib/valgrind
--7792-- Reading syms from /home/shell_way/Repo/my/sudodev/bin/sudodevd
--7792-- Reading syms from /usr/lib/ld-2.23.so
--7792-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--7792-- object doesn't have a symbol table
--7792-- object doesn't have a dynamic symbol table
--7792-- Scheduler: using generic scheduler lock implementation.
--7792-- Reading suppressions file: /usr/lib/valgrind/default.supp
==7792== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-7792-by-root-on-???
==7792== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-7792-by-root-on-???
==7792== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-7792-by-root-on-???
==7792==
==7792== TO CONTROL THIS PROCESS USING vgdb (which you probably
==7792== don't want to do, unless you know exactly what you're doing,
==7792== or are doing some strange experiment):
==7792== /usr/lib/valgrind/../../bin/vgdb --pid=7792 ...command...
==7792==
==7792== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==7792== /path/to/gdb ../bin/sudodevd
==7792== and then give GDB the following command
==7792== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=7792
==7792== --pid is optional if only one valgrind process is running
==7792==
--7792-- REDIR: 0x401aa70 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e171 (???)
--7792-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--7792-- object doesn't have a symbol table
--7792-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--7792-- object doesn't have a symbol table
==7792== WARNING: new redirection conflicts with existing -- ignoring it
--7792-- old: 0x0401aa70 (strlen ) R-> (0000.0) 0x3809e171 ???
--7792-- new: 0x0401aa70 (strlen ) R-> (2007.0) 0x04c2dc60 strlen
--7792-- REDIR: 0x40193c0 (ld-linux-x86-64.so.2:index) redirected to 0x4c2d800 (index)
--7792-- REDIR: 0x40195e0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c2ed10 (strcmp)
--7792-- REDIR: 0x401b810 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c31eb0 (mempcpy)
--7792-- Reading syms from /usr/lib/libpthread-2.23.so
--7792-- Reading syms from /usr/lib/libc-2.23.so
--7792-- REDIR: 0x50d4ed0 (libc.so.6:strcasecmp) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7792-- REDIR: 0x50d08b0 (libc.so.6:strcspn) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7792-- REDIR: 0x50d71c0 (libc.so.6:strncasecmp) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7792-- REDIR: 0x50d2d20 (libc.so.6:strpbrk) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7792-- REDIR: 0x50d30b0 (libc.so.6:strspn) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7792-- REDIR: 0x50d4620 (libc.so.6:memcpy@GLIBC_2.2.5) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7792-- REDIR: 0x50d2a30 (libc.so.6:rindex) redirected to 0x4c2d4e0 (rindex)
==7793== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-7793-by-root-on-???
==7793== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-7793-by-root-on-???
==7793== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-7793-by-root-on-???
==7793==
==7793== TO CONTROL THIS PROCESS USING vgdb (which you probably
==7793== don't want to do, unless you know exactly what you're doing,
==7793== or are doing some strange experiment):
==7793== /usr/lib/valgrind/../../bin/vgdb --pid=7793 ...command...
==7793==
==7793== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==7793== /path/to/gdb ../bin/sudodevd
==7793== and then give GDB the following command
==7793== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=7793
==7793== --pid is optional if only one valgrind process is running
==7793==
==7794== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-7794-by-root-on-???
==7794== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-7794-by-root-on-???
==7794== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-7794-by-root-on-???
==7794==
==7794== TO CONTROL THIS PROCESS USING vgdb (which you probably
==7794== don't want to do, unless you know exactly what you're doing,
==7794== or are doing some strange experiment):
==7794== /usr/lib/valgrind/../../bin/vgdb --pid=7794 ...command...
==7794==
==7794== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==7794== /path/to/gdb ../bin/sudodevd
==7794== and then give GDB the following command
==7794== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=7794
==7794== --pid is optional if only one valgrind process is running
==7794==
--7794-- REDIR: 0x50db840 (libc.so.6:strchrnul) redirected to 0x4c319e0 (strchrnul)
--7792-- REDIR: 0x50cb780 (libc.so.6:free) redirected to 0x4c2bc63 (free)
--7794-- REDIR: 0x50d1110 (libc.so.6:strncat) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7794-- REDIR: 0x50ea160 (libc.so.6:__strncat_sse2_unaligned) redirected to 0x4c2da00 (strncat)
--7793-- REDIR: 0x50cb780 (libc.so.6:free) redirected to 0x4c2bc63 (free)
==7792==
==7792== HEAP SUMMARY:
==7792== in use at exit: 0 bytes in 0 blocks
==7792== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==7792==
==7792== All heap blocks were freed -- no leaks are possible
==7792==
==7792== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==7792== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--7794-- REDIR: 0x50cf300 (libc.so.6:strcmp) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7794-- REDIR: 0x50e05f0 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c2ebd0 (strcmp)
==7793==
==7793== HEAP SUMMARY:
==7793== in use at exit: 0 bytes in 0 blocks
==7793== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==7793==
==7793== All heap blocks were freed -- no leaks are possible
==7793==
==7793== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==7793== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--7794-- REDIR: 0x50cb180 (libc.so.6:malloc) redirected to 0x4c2ab49 (malloc)
--7794-- REDIR: 0x50d3650 (libc.so.6:__GI_strstr) redirected to 0x4c32110 (__strstr_sse2)
--7794-- REDIR: 0x50d98c0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7794-- REDIR: 0x5179cb0 (libc.so.6:__memcpy_avx_unaligned) redirected to 0x4c2f0e0 (memcpy@@GLIBC_2.14)
--7794-- REDIR: 0x50cb820 (libc.so.6:realloc) redirected to 0x4c2ca53 (realloc)
==7794== Conditional jump or move depends on uninitialised value(s)
==7794== at 0x403E7C: readfile (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x403427: find (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x401C5C: main (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794==
--7794-- REDIR: 0x50d0d50 (libc.so.6:strlen) redirected to 0x4c2dba0 (strlen)
--7794-- REDIR: 0x50cb780 (libc.so.6:free) redirected to 0x4c2bc63 (free)
--7794-- REDIR: 0x50cbb00 (libc.so.6:calloc) redirected to 0x4c2c8b1 (calloc)
--7794-- REDIR: 0x50d9940 (libc.so.6:__GI_memcpy) redirected to 0x4c2f740 (__GI_memcpy)
--7794-- REDIR: 0x50d4080 (libc.so.6:__GI_memcmp) redirected to 0x4c307d0 (__GI_memcmp)
--7794-- REDIR: 0x50db630 (libc.so.6:rawmemchr) redirected to 0x4c31a10 (rawmemchr)
--7794-- REDIR: 0x50d4880 (libc.so.6:__GI_mempcpy) redirected to 0x4c31be0 (__GI_mempcpy)
==7794== Conditional jump or move depends on uninitialised value(s)
==7794== at 0x403E7C: readfile (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x403427: find (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x4048BD: enableDropInFile (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x401C73: main (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794==
==7794== Use of uninitialised value of size 8
==7794== at 0x403EA2: readfile (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x403427: find (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x4048BD: enableDropInFile (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x401C73: main (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794==
--7794-- REDIR: 0x50d4480 (libc.so.6:__GI_memmove) redirected to 0x4c31420 (__GI_memmove)
--7794-- REDIR: 0x50d29f0 (libc.so.6:strncpy) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7794-- REDIR: 0x50e7080 (libc.so.6:__strncpy_sse2_unaligned) redirected to 0x4c2e1b0 (__strncpy_sse2_unaligned)
==7794== Conditional jump or move depends on uninitialised value(s)
==7794== at 0x403E7C: readfile (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x402ECC: devs (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794== by 0x401D15: main (in /home/shell_way/Repo/my/sudodev/bin/sudodevd)
==7794==
--7794-- REDIR: 0x50d3ac0 (libc.so.6:strstr) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7794-- REDIR: 0x50eb0f0 (libc.so.6:__strstr_sse2_unaligned) redirected to 0x4c320a0 (strstr)
--7794-- REDIR: 0x50d4680 (libc.so.6:memset) redirected to 0x4a266be (_vgnU_ifunc_wrapper)
--7794-- REDIR: 0x519e780 (libc.so.6:__memset_avx2) redirected to 0x4c31100 (memset)
Arondight commented
Unfortunly this is a bug, for I use wrong way to get length of an array.