Closed matu3ba closed 2 years ago
I'm not a valgrind pro to be honest, what does it mean? The ioctl call in the code looks fine to me at first glance.
Is this perhaps complaining about the libc wrapper for the ioctl systemcall?
I'm not a valgrind pro to be honest, what does it mean?
What are syscall/ioctl wrappers? What do they do?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Valgrind does what it does, in part, by keeping track of everything your
program does. When a system call happens, for example a request to read
part of a file, control passes to the Linux kernel, which fulfills the
request, and returns control to your program. The problem is that the
kernel will often change the status of some part of your program's memory
as a result, and tools (instrumentation plug-ins) may need to know about
this.
Syscall and ioctl wrappers have two jobs:
1. Tell a tool what's about to happen, before the syscall takes place. A
tool could perform checks beforehand, eg. if memory about to be written
is actually writeable. This part is useful, but not strictly
essential.
2. Tell a tool what just happened, after a syscall takes place. This is
so it can update its view of the program's state, eg. that memory has
just been written to. This step is essential.
The "happenings" mostly involve reading/writing of memory.
So, let's look at an example of a wrapper for a system call which
should be familiar to many Unix programmers.
Valgrind does not properly work without knowledge what syscalls do with memory. However in this case, it looks like something fishy is going on as the syscall number should be available to valgrind.
Looks like this ioctl request is not implemented in valgrind.
I don't see any sort of problem with havoc here so I'll close this.
Taken from
memcheck
invalgrind
:What I find really weird is that it shows up
0x5441
, when I have in /usr/include/asm-generic/ioctls.hAt least thats where clangd leads me to on
goto symbol definition
.This looks like a valgrind bug.