Hello All, I think it is a bug or a usercase not managed Valgrind is working on userland binary, but what is the impact of the Kernel/driver land ? By Example : int my_tab[100]; ioctl(fd, IOCTL_MY_FUNC , &my_tab ) if ( my_tab[0] != my_value ) I have a warning on the if condition. ==720== Conditional jump or move depends on uninitialised value(s) I check in my driver source code and the value is set. But I am asking, if is it possible to remove the wrong warning ? Conditional jump or move depends on uninitialised value(s) Best Regards, Frédéric
You will need to teach valgrind about your ioctl as it has to be told what bytes each system call reads/writes (see the code in coregrind/m_syswrap). Alternatively make sure your ioctl number correctly encodes the size and direction hints so that valgrind can use those to work out what is read/written. If this is an ioctl that is part of mainstream kernel.org kernels then we can probably help if you tell us what ioctl it is, but as things stand there is no information here that would allow us to make any changes to valgrind so I am closing this.
It s little bit confused. I am working on my own ioctl/driver #define MY_DRIVER_GET_EVENT _IOR (MY_DRIVER_MAGIC_NUMBER, 1, my_structure) in the "coregrind/m_syswrap" I just see a line LINXY(__NR_ioctl, sys_ioctl), What do you mean by teach to valgrind ?
oh I see, Should I redevelop the function PRE(sys_ioctl) With all my case, case VKI_MY_DRIVER_GET_EVENT: PRE_MEM_READ( "ioctl(MY_DRIVER_GET_EVENT)", ARG3, sizeof(my_structure) ); Is there any script to do it ? ( parsing the headerq where I define my ioctl, and transode in C ? ) Best Regards, Frédéric
Yes, you would need to change PRE(sys_ioctl) and POST(sys_ioctl). See README_MISSING_SYSCALL_OR_IOCTL for more information.
> I am working on my own ioctl/driver > #define MY_DRIVER_GET_EVENT _IOR (MY_DRIVER_MAGIC_NUMBER, 1, my_structure) Actually as long as _IOR is correctly describing the interaction, valgrind should handle that already, no?
Yes, which is what I said in my first reply ;-)
But I declare correctly my ioctl ? and I set the variable in my driver. I will try to add some logs in valgrind tomorrow.