Re: valgrind gets fatal signal when particular syscall is made by an executable

Tom Hughes via Valgrind-users <[email protected]> Mon, 3 Jul 2023 12:15:10 +0100
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
On 03/07/2023 10:42, Daniel Fishman wrote:

> Thanks for the pointer. I just commented out the line for the mentioned syscall
> number from valgrind's syscall table, and this workaround was enough to solve
> the problem. Since the custom syscall doesn't modify its parameters and doesn't
> seem to write anything in user space, it seems that writing a wrapper
> for it is not
> strictly necessary - or very useful for that matter, since in any case
> it won't be
> possible to submit a valgrind patch for the problem.

Well pread will be reading user memory so the wrapper would be
checking that the memory it was given was valid, and that the file
descriptor argument is valid.

Not doing that won't break anything of course, it just means you
may not detect some problems in your program.

> Beyond this problem, maybe it could be useful if upon encountering an impossible
> problem (the one when valgrind writes: "valgrind: the 'impossible' happened"),
> valgrind will send a user to read the file README_MISSING_SYSCALL_OR_IOCTL
> in addition to telling him to read FAQ. Had I been aware of this file
> before, I would have known how to solve the problem myself.

Well sure, but the chances that a random SEGV in valgrind are caused
by a syscall issue are probably less than 1% so doing that would mostly
just be completely misleading.

Tom

-- 
Tom Hughes ([email protected])
http://compton.nu/